Page 1 of 1

[Fixed] Frame inside a Frame using layouts

Posted: 08 Feb 2013, 10:43
by reaby
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

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

Posted: 08 Feb 2013, 10:54
by gouxim
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));

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

Posted: 08 Feb 2013, 10:58
by reaby
gouxim wrote: To fix that, try to set the size also on the Line layout:
Many thanks! It fixed the issue!