Thread Tools Display Modes
10-30-10, 05:57 PM   #1
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
SetTexCoord() for buttons?

I'm attempting to rewrite my first addon from XML into purely Lua which I imagined wouldn't have been a problem. I was wrong :P

In my XML I have:
Code:
<NormalTexture file="interface\targetingframe\ui-raidtargetingicons">
	<TexCoords left="0.75" right="1" top="0.25" bottom="0.5" />
</NormalTexture>
Which works just fine, so I imagined:
Code:
iconSkull:SetNormalTexture("interface\\targetingframe\\ui-raidtargetingicons")
iconSkull:SetTexCoord(0.75,1,0.25,0.5)
would work, but it doesn't.

Is there an API for TexCoord on button's NormalTexture in Lua? Thanks in advanced!
  Reply With Quote
10-30-10, 06:45 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
You're attempting to change the texture coords for the iconSkull frame, not its normal texture object.

Code:
iconSkull:GetNormalTexture():SetTexCoord(0.75,1,0.25,0.5)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh


Last edited by Seerah : 10-30-10 at 07:31 PM. Reason: your ~= you're
  Reply With Quote
10-30-10, 07:10 PM   #3
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
Originally Posted by Seerah View Post
Your attempting to change the texture coords for the iconSkull frame, not its normal texture object.

Code:
iconSkull:GetNormalTexture():SetTexCoord(0.75,1,0.25,0.5)
I figured that was what I had to do but I wasn't sure how to go about it. Thanks very much Seerah!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SetTexCoord() for buttons?


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