[Fixed] Frame inside a Frame using layouts

Open source, lightweight PHP framework for Manialink and Web development.

Moderator: NADEO

Post Reply
reaby
Posts: 1022
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

[Fixed] Frame inside a Frame using layouts

Post by reaby » 08 Feb 2013, 10:43

Hey..

I'm using frame inside frame using layouts..

Code: Select all

Manialink::beginFrame(6, -12, 1, 1, new Column());
            {
            $tracks = Array("map1", "map2", "map3");

            foreach ($tracks as $track) {
                    $frame = new Frame(120,5);
                    $frame->setSize(120, 4);
                    $frame->setLayout(new Line());

                    $ui = new Label(120, 4);
                    $ui->setSize(120, 4);
                    $ui->setText($track);
                    $frame->add($ui);
                    $frame->save();
                }
            }
            Manialink::endFrame();
Problem is the positioning of the frames,, it's always -20 to precussor

Code: Select all

<frame posn="6 -12 1" scale="1">
<frame>
<label posn="0 0 0.1" sizen="120 4" style="TextStaticSmall" text="map1"/>
</frame>
<frame posn="0 -20 0">
<label posn="0 0 0.1" sizen="120 4" style="TextStaticSmall" text="map2"/>
</frame>
<frame posn="0 -40 0">
<label posn="0 0 0.1" sizen="120 4" style="TextStaticSmall" text="map3"/>
</frame>
</frame>
Is there a bug, or what i do wrong :)

Thanks for advices,
Reaby

User avatar
gouxim
Nadeo
Nadeo
Posts: 1188
Joined: 14 Jun 2010, 17:20

Re: a Frame inside a Frame using layouts.. problem with posi

Post by gouxim » 08 Feb 2013, 10:54

The positioning of the Frames inside the columns is determined by the frames' layouts (the Lines).

If things were done right ( :lol: ), the Line layouts should automatically take the Frame's size. I'm not sure it's the case though. And i'm pretty sure the default size for Line is 20x20, hence the 20 increments in posyn.

To fix that, try to set the size also on the Line layout:

Code: Select all

 $frame->setLayout(new Line(120, 4));
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

reaby
Posts: 1022
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: a Frame inside a Frame using layouts.. problem with posi

Post by reaby » 08 Feb 2013, 10:58

gouxim wrote: To fix that, try to set the size also on the Line layout:
Many thanks! It fixed the issue!

Post Reply

Return to “ManiaLib”

Who is online

Users browsing this forum: No registered users and 2 guests