Thread Tools Display Modes
03/03/15, 07:17 PM   #1
Weolo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 79
XML Button with Multiple Textures

I am having trouble creating an XML button which uses 3 textures.
Is this syntax correct?
Lua Code:
  1. <Button>
  2.     <Anchor point="TOPLEFT" offsetX="5" offsetY="5" />
  3.     <Dimensions x="50" y="50" />
  4.     <Textures normal="EsoUI/Art/Buttons/decline_up.dds" pressed="EsoUI/Art/Buttons/decline_down.dds" mouseOver="EsoUI/Art/Buttons/decline_over.dds" />
  5.     <OnClicked>DoSomething()</OnClicked>
  6. </Button>
  Reply With Quote
03/03/15, 08:09 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,995
I think you are missing the starting slash "/" at the texture names?
Try these:

Lua Code:
  1. Button>
  2.     <Anchor point="TOPLEFT" offsetX="5" offsetY="5" />
  3.     <Dimensions x="50" y="50" />
  4.     <Textures normal="/EsoUI/Art/Buttons/decline_up.dds" pressed="/EsoUI/Art/Buttons/decline_down.dds" mouseOver="/EsoUI/Art/Buttons/decline_over.dds" />
  5.     <OnClicked>DoSomething()</OnClicked>
  6. </Button>
  Reply With Quote
03/04/15, 02:57 AM   #3
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
The leading slash in path is not required. Not sure you can have unnamed controls in XML, though, try <Button name="Nottub"> ...
  Reply With Quote
03/04/15, 05:01 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by merlight View Post
The leading slash in path is not required. Not sure you can have unnamed controls in XML, though, try <Button name="Nottub"> ...
If you don't need global reference to the control, you can leave it unnamed. I'm using unnamed controls in ShieldInfo:
Lua Code:
  1. <Texture textureFile="EsoUI/Art/Repair/inventory_tabicon_repair_up.dds">
  2.     <Anchor point="LEFT" />
  3.     <Dimensions x="64" y="64" />
  4.     <OnInitialized>
  5.         self:GetParent().icon = self
  6.     </OnInitialized>
  7. </Texture>
  Reply With Quote
03/04/15, 01:55 PM   #5
Weolo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 79
After the update 6 patch the button came to life.
Some kind of cache thing I guess.
  Reply With Quote
03/04/15, 02:10 PM   #6
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Weolo View Post
After the update 6 patch the button came to life.
Some kind of cache thing I guess.
If some texture is not visible, it helps if you exit the game and delete shader cache:
My Documents/Elder Scrolls Online/live/ShaderCache.cooked
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » XML Button with Multiple Textures


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