Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-22-10, 09:30 PM   #1
braininblack
A Murloc Raider
 
braininblack's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 8
SetTexture(path, false) = nil Value?

Hi guys,

i want to use SetTexture on the my XML-Button-Template:
Code:
<!-- Template -->
<Button name="ToolbarButtonTemplate" virtual="true">
	<Size>
		<AbsDimension x="26" y="26" />
	</Size>
	<Layers>
		<Layer level="ARTWORK">
			<Texture name="$parentIcon">
				<Size>
					<AbsDimension x="20" y="20" />
				</Size>
				<Anchors>
					<Anchor point="CENTER" />
				</Anchors>
			</Texture>
		</Layer>
	</Layers>
	<Backdrop edgeFile="Interface\AddOns\MarkBar\tex\border.tga" tile="false">
		<EdgeSize>
			<AbsValue val="10" />
		</EdgeSize>
	</Backdrop>
	<Scripts>
		<OnLoad>
			MarkBar.MarkOnLoad(self);
		</OnLoad>
	</Scripts>
	<!-- Some More Scripts -->
</Button>

<!-- Button -->
<Button name="MarkBarMarkM1" inherits="ToolbarButtonTemplate" id="1">
	<Anchors>
		<Anchor point="TOPLEFT">
			<Offset>
				<AbsDimension x="186" y="-4"/>
			</Offset>
		</Anchor>
	</Anchors>
</Button>

OnLoad run this script:
Code:
function MarkBar.MarkOnLoad(self)
	local frame = self:GetName();
	local id = self:GetID();
	local icon = frame.."Icon";
	local path = "Interface\\AddOns\\MarkBar\\tex\\"..id..".tga";

	self:SetTexture(path, false);
end
And some other stuff, but have nothing to do with the SetTexture() stuff.


With this code, i getting a nil value for SetTexture(), even when i hardcode the path ("Interface\\AddOns\\MarkBar\\tex\1.tga"). Whats wrong with that?


Sry for the bad english. itīs a quite while since i used english for describing a problem
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » SetTexture(path, false) = nil Value?


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