A Cyclonian
Join Date: Oct 2010
Posts: 44
|
Thanks Katae, I needed those numbers, which are all exponential powers of 2, I guess. Problem is, the only number that divides evenly into 1440 (widescreen) is 8. I'd have to make 180 panels each 8px wide, which is just not going to happen.
Edit: Nothing worked as planned, so I redesigned my original as 2048 px wide x 512 tall, and sliced it into 512x512 tiles. Now I have some odd lines where the graphics meet, as shown by the yellow arrows I added on this image:
http://www.instancia.net/images/question.jpg
Is my code ok? This is the entirety of my file.
Code:
lpanels:CreateLayout("Background", {
-- Art Container
{ name="bg", width="100%", height=364, bg_alpha=0, level=0 },
-- Texture #1
{ name="bg1", parent="bg", tex_file="grad1a", bg_alpha=.8,
anchor_to="LEFT", width="25%", height="100%" },
-- Texture #2
{ name="bg2", parent="bg", tex_file="grad1b", bg_alpha=.8,
anchor_to="RIGHT", anchor_from="CENTER", width="25%", height="100%" },
-- Texture #3
{ name="bg3", parent="bg", tex_file="grad1c", bg_alpha=.8,
anchor_to="LEFT", anchor_from="CENTER", width="25%", height="100%" },
-- Texture #4
{ name="bg4", parent="bg", tex_file="grad1d", bg_alpha=.8,
anchor_to="RIGHT", width="25%", height="100%" }
})
lpanels:CreateLayout("Foreground", {
-- Art Container
{ name="fg", width="100%", height=364, bg_alpha=0, level=0 },
-- Texture #1
{ name="fg1", parent="fg", tex_file="hand1a", bg_alpha=1,
anchor_to="LEFT", width="25%", height="100%" },
-- Texture #2
{ name="fg2", parent="fg", tex_file="hand1b", bg_alpha=1,
anchor_to="RIGHT", anchor_from="CENTER", width="25%", height="100%" },
-- Texture #3
{ name="fg3", parent="fg", tex_file="hand1c", bg_alpha=1,
anchor_to="LEFT", anchor_from="CENTER", width="25%", height="100%" },
-- Texture #4
{ name="fg4", parent="fg", tex_file="hand1d", bg_alpha=1,
anchor_to="RIGHT", width="25%", height="100%" }
})
lpanels:ApplyLayout(nil, "Background")
lpanels:ApplyLayout(nil, "Foreground")
This seemed a little unstable codewise, so I added levels into each texfile:
Code:
lpanels:CreateLayout("Background", {
{ name="bg", width="100%", height=364, bg_alpha=0, level=0 },
{ name="bg1", parent="bg", tex_file="grad1a", bg_alpha=.7,
anchor_to="LEFT", width="25%", height="100%", level=0 },
{ name="bg2", parent="bg", tex_file="grad1b", bg_alpha=.7,
anchor_to="RIGHT", anchor_from="CENTER", width="25%", height="100%", level=0 },
{ name="bg3", parent="bg", tex_file="grad1c", bg_alpha=.7,
anchor_to="LEFT", anchor_from="CENTER", width="25%", height="100%", level=0 },
{ name="bg4", parent="bg", tex_file="grad1d", bg_alpha=.7,
anchor_to="RIGHT", width="25%", height="100%", level=0 },
{ name="fg1", parent="bg", tex_file="hand1a", bg_alpha=1,
anchor_to="LEFT", width="25%", height="100%", level=1 },
{ name="fg2", parent="bg", tex_file="hand1b", bg_alpha=1,
anchor_to="RIGHT", anchor_from="CENTER", width="25%", height="100%", level=1 },
{ name="fg3", parent="bg", tex_file="hand1c", bg_alpha=1,
anchor_to="LEFT", anchor_from="CENTER", width="25%", height="100%", level=1 },
{ name="fg4", parent="bg", tex_file="hand1d", bg_alpha=1,
anchor_to="RIGHT", width="25%", height="100%", level=1 }
})
lpanels:ApplyLayout(nil, "Background")
Which code is more correct, please?
Last edited by Lyelu : 10-07-10 at 07:01 PM.
|