View Single Post
01-15-10, 11:07 PM   #1
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Textured combo points w/borders

Hi all. Trying to make some headway on textured combo points. I have the following so far to call the combo points, which results in rectangles for combo points.

Code:
                        self.CPoints = {}
			self.CPoints.unit = PlayerFrame.unit
			for i = 1, 5 do
				self.CPoints[i] = self.Health:CreateTexture(nil, "OVERLAY")
				self.CPoints[i]:SetHeight(10)
				self.CPoints[i]:SetWidth(38)
				self.CPoints[i]:SetTexture(bartex)	
				if i == 1 then
					self.CPoints[i]:SetPoint("LEFT", self.Health, "LEFT", 0, 20)
					self.CPoints[i]:SetVertexColor(0.69, 0.31, 0.31)
				else
					self.CPoints[i]:SetPoint("LEFT", self.CPoints[i-1], "RIGHT", 3, 0)
				end
			end
		self.CPoints[2]:SetVertexColor(0.69, 0.31, 0.31)
		self.CPoints[3]:SetVertexColor(0.65, 0.63, 0.35)
		self.CPoints[4]:SetVertexColor(0.65, 0.63, 0.35)
		self.CPoints[5]:SetVertexColor(0.33, 0.59, 0.33)
And the following to put a border around them, but I keep getting an error. I think it's having issues with creating a texture.

Code:
                        local TopLeft = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			TopLeft:SetTexture(frameborder)
			TopLeft:SetTexCoord(0, 1/3, 0, 1/3)
			TopLeft:SetPoint("TOPLEFT", -3, 3)
			TopLeft:SetWidth(14) TopLeft:SetHeight(14)
			TopLeft:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
	
			local TopRight = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			TopRight:SetTexture(frameborder)
			TopRight:SetTexCoord(2/3, 1, 0, 1/3)
			TopRight:SetPoint("TOPRIGHT", 3, 3)
			TopRight:SetWidth(14) TopRight:SetHeight(14)
			TopRight:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)

			local BottomLeft = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			BottomLeft:SetTexture(frameborder)
			BottomLeft:SetTexCoord(0, 1/3, 2/3, 1)
			BottomLeft:SetPoint("BOTTOMLEFT", -3, -3)
			BottomLeft:SetWidth(14) BottomLeft:SetHeight(14)
			BottomLeft:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)

			local BottomRight = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			BottomRight:SetTexture(frameborder)
			BottomRight:SetTexCoord(2/3, 1, 2/3, 1)
			BottomRight:SetPoint("BOTTOMRIGHT", 3, -3)
			BottomRight:SetWidth(14) BottomRight:SetHeight(14)
			BottomRight:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)

			local TopEdge = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			TopEdge:SetTexture(frameborder)
			TopEdge:SetTexCoord(1/3, 2/3, 0, 1/3)
			TopEdge:SetPoint("TOPLEFT", TopLeft, "TOPRIGHT")
			TopEdge:SetPoint("TOPRIGHT", TopRight, "TOPLEFT")
			TopEdge:SetHeight(14)
			TopEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
		
			local BottomEdge = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			BottomEdge:SetTexture(frameborder)
			BottomEdge:SetTexCoord(1/3, 2/3, 2/3, 1)
			BottomEdge:SetPoint("BOTTOMLEFT", BottomLeft, "BOTTOMRIGHT")
			BottomEdge:SetPoint("BOTTOMRIGHT", BottomRight, "BOTTOMLEFT")
			BottomEdge:SetHeight(14)
			BottomEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
		
			local LeftEdge = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			LeftEdge:SetTexture(frameborder)
			LeftEdge:SetTexCoord(0, 1/3, 1/3, 2/3)
			LeftEdge:SetPoint("TOPLEFT", TopLeft, "BOTTOMLEFT")
			LeftEdge:SetPoint("BOTTOMLEFT", BottomLeft, "TOPLEFT")
			LeftEdge:SetWidth(14)
			LeftEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
		
			local RightEdge = self.CPoints[i]:CreateTexture(nil, "OVERLAY")
			RightEdge:SetTexture(frameborder)
			RightEdge:SetTexCoord(2/3, 1, 1/3, 2/3)
			RightEdge:SetPoint("TOPRIGHT", TopRight, "BOTTOMRIGHT")
			RightEdge:SetPoint("BOTTOMRIGHT", BottomRight, "TOPRIGHT")
			RightEdge:SetWidth(14)
			RightEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
For now, I am commenting out the border since it gives me an error:

Code:
layout.lua:931: attempt to call method 'CreateTexture' (a nil value)
Any ideas on how I can get the border to appear around the combo point textures? Thank you!
  Reply With Quote