Thread Tools Display Modes
Prev Previous Post   Next Post Next
11/08/16, 05:46 PM   #1
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
Define texture size in xml

Hey guys,

there is a little problem that currently drives me into desperation. Lets take the following example:

Code:
-- results in a button control of 24x24 with a smaller texture in it
<Button name="$(parent)_CloseButton" clickSound="Click">
  <Dimensions x="24" y="24" />
  <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="0" offsetY="0" />
  <Textures normal="EsoUI/Art/Buttons/closebutton_up.dds" pressed="EsoUI/Art/Buttons/closebutton_down.dds" mouseOver="EsoUI/Art/Buttons/closebutton_mouseover.dds" disabled="EsoUI/Art/Buttons/closebutton_disabled.dds" />
</Button>
Although the button has a size of 24x24 the texture is not stretched to match its size. If I use lua to initialize the control OR to modify it after its xml has been loaded, it works as intended and the texture is stretched to match the buttons actual size:

Code:
-- will result in a texture of 24x24
local button = WM:GetControlByName("someButtonControl")

button:SetNormalTexture("/esoui/art/buttons/decline_up.dds");
button:SetMouseOverTexture("/esoui/art/buttons/decline_over.dds");
button:SetPressedTexture("/esoui/art/buttons/decline_down.dds");
Some enlightenment would be much appreciated, because I'd like to use XML for setting up the UI.
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Define texture size in xml


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off