View Single Post
12-19-10, 09:26 AM   #292
zynix
A Cliff Giant
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 70
Originally Posted by Creatan View Post
I'm having problems with textures. The layout that I create works fine and shows up as expected when I don't have the texture file declaration in there, but when I do the panel isn't created.
Code:
lpanels:CreateLayout("Load For All", {
	-- Create a global layout right here
	--Chat frame
	{
		name = "ChatBox", parent = "UIParent",
		anchor_to = "BOTTOMLEFT", anchor_from = "BOTTOMLEFT",
		x_off = 3, y_off = 28,
		width = 375, height = 170,
		bg_color= "0 0 0", bg_alpha = 0.5,
		tex_file = "Interface\\Addons\\LitePanels\\media\\texture.tga"
	},	
})
There is a problem with the tex_file command.
Workaround:
Code:
 --Chat frame
	{
		name = "ChatBox", parent = "UIParent",
		anchor_to = "BOTTOMLEFT", anchor_from = "BOTTOMLEFT",
		x_off = 3, y_off = 28,
		width = 375, height = 170,
                OnLoad = function(self)
	        self.bg:SetTexture("Interface\\Addons\\LitePanels\\media\\texture.tga") -- Path to the texture
	        self.bg:SetVertexColor(0, 0, 0, .5) -- (red, green, blue, alpha)
	        self.bg:SetHorizTile(false) -- Do you want it to repeat itself horizontaly, then true. If not, then false
	        self.bg:SetVertTile(false) -- Same as before, but vertical
	        end,
	},
This should work, if "texture.tga" is located in the media folder

Last edited by zynix : 12-19-10 at 09:31 AM. Reason: Made it more userfriendly
  Reply With Quote