Originally Posted by richerich
I wanna make it look like THIS.
|
I'm going to assume for a minute that it's one image and not three. From the screenshot, it looks like 1280x154 and slightly transparent, so here's what you may be looking for:
Code:
["Default"] = {
{ width=1280, height=154, tex_file="texture", bg_alpha=.95, level=0 }
}
You can use "100%" as the width as well. Also, tex_file is assuming filenames with no path ("texture.tga") are in "Interface\\AddOns\\LitePanels\\media\\".
Placing art with 3 sections +Viewport
The left and right images can both be set to a static width, and the middle image will be stretched to fit any resolution.
Code:
lpanels:CreateLayout("Viewport Art x3", {
-- Art Container
{ name="Art", width="100%", height=154, bg_alpha=0, level=0 },
-- Left Section
{ name="Art_L", parent="Art", anchor_to="LEFT", height="100%",
tex_file="texture_left", width=400 },
-- Right Section
{ name="Art_R", parent="Art", anchor_to="RIGHT", height="100%",
tex_file="texture_right", width=400 },
-- Middle Section
{ name="Art_M", parent="Art", anchor_to="CENTER", height="100%",
tex_file="texture_middle",
OnLoad=function(self) self:SetWidth(self:GetParent():GetWidth() - LP_Art_L:GetWidth() - LP_Art_R:GetWidth()) end
},
}, { bottom=154 }) -- Viewport (Optional)
lpanels:ApplyLayout(nil, "Viewport Art x3")
Placing art with 4 sections
This was a bit easier than 3 since they can all be 25% width.
Code:
lpanels:CreateLayout("Art x4", {
-- Art Container
{ name="Art", width="100%", height=200, bg_alpha=0, level=0 },
-- Texture #1
{ name="Art1", parent="Art", tex_file="texture-1", bg_alpha=.95,
anchor_to="LEFT", width="25%", height="100%" },
-- Texture #2
{ name="Art2", parent="Art", tex_file="texture-2", bg_alpha=.95,
anchor_to="RIGHT", anchor_from="CENTER", width="25%", height="100%" },
-- Texture #3
{ name="Art3", parent="Art", tex_file="texture-3", bg_alpha=.95,
anchor_to="LEFT", anchor_from="CENTER", width="25%", height="100%" },
-- Texture #4
{ name="Art4", parent="Art", tex_file="texture-4", bg_alpha=.95,
anchor_to="RIGHT", width="25%", height="100%" }
})
lpanels:ApplyLayout(nil, "Art x4")
Viewport Only
Only want a simple viewport? This is all you need.
Code:
lpanels:CreateLayout("Viewport", nil, {bottom=20, top=20})
lpanels:ApplyLayout(nil, "Viewport")