View Single Post
09-16-09, 05:36 PM   #1187
Icerat
A Fallenroot Satyr
Join Date: Sep 2006
Posts: 28
Hi and many thanks for the reply

If i add what you sugested i get an error and at this time my knowladge is not there to fix it.

I have:
Code:
--	RESTING ICON	
	if(unit == "player") then
		if UnitLevel("player") ~= MAX_PLAYER_LEVEL then
			self.Resting = self.Health:CreateTexture(nil, "OVERLAY")
			self.Resting:SetHeight(6)
			self.Resting:SetWidth(6)
			self.Resting:SetPoint("BOTTOMLEFT", 13, -15)
			self.Resting:SetTexture(1, 1, 0)
			
			self.Resting.bg = self.Resting:CreateTexture(nil, "BACKGROUND")
			self.Resting.bg:SetPoint("TOPLEFT",self.Health,"TOPLEFT",-1,1)
			self.Resting.bg:SetPoint("BOTTOMRIGHT",self.Health,"BOTTOMRIGHT",1,-1)	
			self.Resting.bg:SetVertexColor(0, 0, 0, 1)
			

		end	
	end
Which give error:
Code:
[2009/09/17 00:19:34-5479-x1]: oUF_Harpz-1.1h\oUF_Harpz.lua:575: attempt to call method 'CreateTexture' (a nil value)
oUF-1.3.21\ouf.lua:250: in function <Interface\AddOns\oUF\ouf.lua:242>
oUF-1.3.21\ouf.lua:318: in function <Interface\AddOns\oUF\ouf.lua:315>
oUF-1.3.21\ouf.lua:368: in function `Spawn'
oUF_Harpz-1.1h\oUF_Harpz.lua:755: in main chunk

  ---
What you said did get me thinking though be it in a nub way
Code:
--	RESTING ICON	
	if(unit == "player") then
		if UnitLevel("player") ~= MAX_PLAYER_LEVEL then
			self.Resting = self.Health:CreateTexture(nil, "OVERLAY")
			self.Resting:SetHeight(6)
			self.Resting:SetWidth(6)
			self.Resting:SetPoint("BOTTOMLEFT", 13, -15)
			self.Resting:SetTexture(1, 1, 0)
			
			self.Resting.bg = self.Health:CreateTexture(nil, "BACKGROUND")
			self.Resting.bg:SetPoint("BOTTOMLEFT", 10, -19)
			self.Resting.bg:SetHeight(13)
			self.Resting.bg:SetWidth(13)
			self.Resting.bg:SetTexture(0, 0, 0, 1)
			
		end	
	end
It generates a block i can move to behind my rested square, your way looks alot better then my nub attempts why didn't it work

Also another nub question why are there 2 set points
Code:
self.Resting.bg:SetPoint("TOPLEFT",self.Health,"TOPLEFT",-1,1)
self.Resting.bg:SetPoint("BOTTOMRIGHT",self.Health,"BOTTOMRIGHT",1,-1)
Once again i thank you for the help I'm learning alot, if this isn't the place to ask these question please direct me in the right direction