Thread Tools Display Modes
08-22-10, 01:38 PM   #1
Erina29
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 12
NormalTexture

Good morning.
It's probably just stupid but I just can not translate this line button in LUA.
Can someone help me?
<NormalTexture name="HealthColorTexture" file="Interface\ChatFrame\ChatFrameColorSwatch"/>
  Reply With Quote
08-22-10, 01:46 PM   #2
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
You're looking for SetNormalTexture

Code:
button:SetNormalTexture("Interface\\ChatFrame\\ChatFrameColorSwatch")
__________________
« Website | GitHub »

Oh hai!
  Reply With Quote
08-22-10, 02:06 PM   #3
Erina29
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 12
<Button name="HealthColor_Button">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SkinMenu" relativeFrom="TOPLEFT">
<Offset>
<AbsDimension x="35" y="-40" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="HealthColorBackTexture">
<Size>
<AbsDimension x="14" y="14"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1.0" g="1.0" b="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
HealthColorClick();
</OnClick>
<OnEnter>
HealthColorBackTexture:SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
</OnEnter>
<OnLeave>
HealthColorBackTexture:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
</OnLeave>
</Scripts>
<NormalTexture name="HealthColorTexture" file="Interface\ChatFrame\ChatFrameColorSwatch"/>

The problem is that the name is different from the normal texture of the button.
I would like to
button: SetNormalTexture (name, file)
But it makes me put an error.
  Reply With Quote
08-22-10, 02:29 PM   #4
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
You can't put two arguments to SetNormalTexture.

How about HealthColorBackTexture:SetNormalTexture("yourtexturepath")?
  Reply With Quote
08-22-10, 03:51 PM   #5
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
Code:
local texture = HealthColor_Button:CreateTexture("HealthColorTexture")
texture:SetTexture("Interface\\ChatFrame\\ChatFrameColorSwatch")

HealthColor_Button:SetNormalTexture(texture)
Or just:
Code:
HealthColor_Button:SetNormalTexture("Interface\\ChatFrame\\ChatFrameColorSwatch")
HealthColorTexture = HealthColor_Button:GetNormalTexture()
__________________
« Website | GitHub »

Oh hai!
  Reply With Quote
08-22-10, 05:45 PM   #6
Erina29
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 12
it's good thank you.

Last edited by Erina29 : 08-22-10 at 05:53 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » NormalTexture


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