Thread Tools Display Modes
02-28-10, 12:11 AM   #1
Cirdan
A Murloc Raider
Join Date: Feb 2010
Posts: 5
Texture disappearing

So I'm working on my own addon, and I want to display how much money I have. I want to use the coin icons, which I have displaying fine. However, whenever I use SetTexCoord, the image disappears. I've tried several different values, and none of them work.

Code:
local img = rcHud:CreateTexture(nil, 'OVERLAY', true)
img:SetPoint('LEFT', text2, 'RIGHT')
img:SetWidth(16)
img:SetHeight(16)
img:SetTexCoord(0.5,0.5,0,1)
img:SetTexture('Interface\\MoneyFrame\\UI-MoneyIcons')
If I remove the SetTexCoord and the size, it displays the whole image fine.
  Reply With Quote
02-28-10, 12:34 AM   #2
alimjocox
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 96
well my attempt to help is violenty ripped apart and spat on. so i'll take it away

Last edited by alimjocox : 02-28-10 at 07:03 AM.
  Reply With Quote
02-28-10, 03:53 AM   #3
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by alimjocox View Post
imo u should use SetAllPoints
also the common texcoord around is around (0.1,0.9,0.1,0.9)
No it's (.08, .92, .08, .92). And that is only for actionbuttons.

And about the "imo u should use SetAllPoints"... What the **** are you talking about?
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.

Last edited by nightcracker : 02-28-10 at 06:58 AM.
  Reply With Quote
02-28-10, 05:55 AM   #4
Foxlit
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 91
Originally Posted by Cirdan View Post
However, whenever I use SetTexCoord, the image disappears.
Code:
img:SetTexCoord(0.5,0.5,0,1)
img:SetTexture('Interface\\MoneyFrame\\UI-MoneyIcons')
You'll probably want to call SetTexture prior to SetTexCoord; also, be mindful of the latter's signature: (left, right, top, bottom). In your SetTexCoord call, both left and right are equal to 0.5 -- the area that you request wow to display is empty -- and that results in an empty image.
__________________
... and you do get used to it, after a while.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Texture disappearing


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