Sharing layout??

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

masch
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Wed Mar 18, 2009 15:37

Sharing layout??

Postby masch » Thu Apr 30, 2009 12:34

Hello...
Is it possible to make a layout with 2 or or layout??..
For example: I have layout_1, layout_2 and layout_3 and I create a layout_4= layout_1 + layout_2 and another layout_5=layout_1+layout_3.

Salu2...
masch...

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Sharing layout??

Postby CrazyEddie » Fri May 01, 2009 08:54

Yes, but with the caveat that you need to avoid name clashes (maybe by use of a naming prefix).

You include a layout as content of a Window in another layout via the LayoutImport tag, which takes Filename, ResourceGroup and Prefix attributes.

Example:

Code: Select all

<GUILayout>
    <Window Type="DefaultWindow" Name="layout_4_root">
        <LayoutImport Filename="layout_1.layout" Prefix="layout_4_root/" />
        <LayoutImport Filename="layout_2.layout" Prefix="layout_4_root/" />
    </Window>
</GUILayout>

and

Code: Select all

<GUILayout>
    <Window Type="DefaultWindow" Name="layout_5_root">
        <LayoutImport Filename="layout_1.layout" Prefix="layout_5_root/" />
        <LayoutImport Filename="layout_3.layout" Prefix="layout_5_root/" />
    </Window>
</GUILayout>



Note that I believe CELayoutEditor is not currently aware of this system, so loading such a layout and resaving will result in different XML between the original and saved versions (the saved version will explicitly include all windows rather than use the imports).

CE.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Sharing layout??

Postby scriptkid » Fri May 01, 2009 09:50

CrazyEddie wrote:Note that I believe CELayoutEditor is not currently aware of this system, so loading such a layout and resaving will result in different XML between the original and saved versions (the saved version will explicitly include all windows rather than use the imports).


Yes, that's true. Thanks for the heads-up on this, i've raised a ticket:
http://www.cegui.org.uk/mantis/view.php?id=294
Check out my released snake game using Cegui!

masch
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Wed Mar 18, 2009 15:37

Re: Sharing layout??

Postby masch » Fri May 01, 2009 14:17

Great Eddie!....It's exactly what I need, but I like the hard way to do it, I use gedit to make the layout .:D

Thanks!...

masch
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Wed Mar 18, 2009 15:37

Re: Sharing layout??

Postby masch » Mon May 04, 2009 15:14

I have working differents layout, but I have a problem with ZOrderChangeEnabled property. Is it possible that the property does not work between layout?? Because when I put the property in false and I do a mouse click to the parent layout, the child layout disappear.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Sharing layout??

Postby scriptkid » Mon May 04, 2009 19:09

I am not sure what exactly goes wrong, but a hierarchie in a layout is just relative. As soon as a layout is loaded, the concept of layout is lost in Cegui and Z ordering takes into account all currently windows in the WindowManager.

HTH.
Check out my released snake game using Cegui!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests