Problem with panels

Don’t know what is happening, I just copied the nifty’s gui example, and tried to add two text labels instead of one.

But instead of centering them both, it only centers one, why?

Must I only have 1 child on each panel? (making them useless)

[code title=""]panel(new PanelBuilder(“Panel_ID”) {{
childLayoutCenter(); // panel properties, add more…

                // GUI elements
                /*control(new ButtonBuilder("button", "Hello Nifty"){{
                    alignCenter();
                    valignCenter();
                    height("5%");
                    width("15%");
                }});*/
               text(new TextBuilder() {{
                    text("My Cool Game");
                    font("Interface/Fonts/Default.fnt");
                    height("40%");
                    width("40%");
                }});
               
               text(new TextBuilder() {{
                    text("My Cool Game");
                    font("Interface/Fonts/Default.fnt");
                    height("40%");
                    width("40%");
                }});
 
            }});[/code]

childLayoutCenter() centers everything. You probably want childLayoutVertical.
Read the manual, it goes into all the layouts in detail.

Don’t really know what you mean, if you look at the screenshot does is exactly what it doesn’t, because first text is placed in the center.
But next one appers at top-left corner

childLayoutCenter with old nifty versions only works on the first element in the panel. On the most recent nifty it centers them all. Either way it isn’t the layout you want. RTFM.

yh, the latest nifty should center them both, are you running the RC2 SDK?

Wasn’t running the lastest version, downloading now. Probebly going to work thanks ^^