Problem using includes and constants in XML gui
#1
I'm playing with writing an add-on that uses XML files for the GUI. The problem I'm having is using includes and constants. For example, I defined a constant representing a color value (ARGB) to use with the <texturediffuse> tag. When I use the constant I don't see the texture. However, if I use the literal value for the tag, the texture is visible.
The constant definition:
<constant name='mycolor'>FFAA00AA</constant>
Anyone have
Reply
#2
Constants are only for numeric floating point values used in coordinates (e.g. for <left> <width> etc.)
Colours are defined in the colors/defaults.xml file in the skin folder. Add-ons can't define colours or fonts, only skins can. If you want to use a colour in your add-on, you will have to input the hex value directly.

From the skinning manual:
Quote:... the <constant> tag allows you to define a numeric (floating point) constant by name for use in place of numeric values (<left>, height="" etc.) would otherwise be used. This allows alignment of items using the same position values which can then easily be altered in one place.
https://kodi.wiki/view/Skinning_Manual
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
addons can not use includes, nor constants.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
I want to do something similar in my addon.

The way I am planning to do this is like this:
In your addon code set the color as Skin.String
Code:
xbmc.executebuiltin('Skin.SetString(mycolor,FF12A0C7)')
In the skin xml file read the color like this:
Code:
<texturefocus colordiffuse="$INFO[Skin.String(mycolor)]">MenuItemFO.png</texturefocus>
Not sure if this approach fits your needs. Just wanted to throw it in.
Reply

Logout Mark Read Team Forum Stats Members Help
Problem using includes and constants in XML gui0