Resize of MenuItems when changing the window size.

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

Nimos
Just popping in
Just popping in
Posts: 12
Joined: Sun Jan 04, 2009 20:13

Resize of MenuItems when changing the window size.

Postby Nimos » Sun Jan 04, 2009 20:37

Hi,

I am writing a game that uses SDL and OpenGL. I have encountered a problem when resizing (enlarging) the window. The menuitem background does not seem to resize for me although the items' text does. This causes the the last buttons to fall outside the menu and turn invisible. Also the visible ones have their text truncated.
Setting ClippedByParent to false helps me see them but they are still outside the menu background and every items' text is still truncated.

When resizing I use the method recommended in the tutorial about CEGUI with SDL and OpenGL:

case SDL_VIDEORESIZE:
renderer->grabTextures();
//your resize code here, including the SDL_SetVideoMode call
renderer->restoreTextures();
renderer->setDisplaySize(CEGUI::Size(e.resize.w, e.resize.h));
break;

Am I doing something wrong?

Regards
Nimos


Here is an excerpt of my XML-file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<GUILayout >
    <Window Type="DefaultWindow" Name="Root" >
        <Property Name="InheritsAlpha" Value="False" />
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="TaharezLook/Menubar" Name="Root/FrameWindow/Menubar" >
                <Property Name="ItemSpacing" Value="10" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.001,0},{0,0},{0.999,0},{0.05,0}}" />
                <Window Type="TaharezLook/MenuItem" Name="Root/FrameWindow/Menubar/Help" >
                    <Property Name="Text" Value="Help" />
                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                    <Property Name="UnifiedAreaRect" Value="{{0,74},{0,0},{0,100},{0,21}}" />
                    <Property Name="VerticalAlignment" Value="Centre" />
                    <Window Type="TaharezLook/PopupMenu" Name="Root/FrameWindow/Menubar/Help/AutoPopup" >
                        <Property Name="Visible" Value="False" />
                        <Property Name="FadeInTime" Value="0" />
                        <Property Name="FadeOutTime" Value="0" />
                        <Property Name="ItemSpacing" Value="2" />
                        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                        <Property Name="ClippedByParent" Value="False" />
                        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0,64},{0,72}}" />
                        <Property Name="AutoResizeEnabled" Value="True" />
                        <Window Type="TaharezLook/MenuItem" Name="Root/FrameWindow/Menubar/Help/Controls" >
                            <Property Name="Text" Value="Controls..." />
                            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                            <Property Name="UnifiedAreaRect" Value="{{0,2},{0,2},{0,61},{0,23}}" />
                            <Property Name="ClippedByParent" Value="False" />
                        </Window>
                        <Window Type="TaharezLook/MenuItem" Name="Root/FrameWindow/Menubar/Help/About" >
                            <Property Name="Text" Value="About the game..." />
                            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                            <Property Name="UnifiedAreaRect" Value="{{0,2},{0,25},{0,61},{0,46}}" />
                            <Property Name="ClippedByParent" Value="False" />
                        </Window>
                        <Window Type="TaharezLook/MenuItem" Name="Root/FrameWindow/Menubar/Help/Highscore" >
                            <Property Name="Text" Value="Show highscores..." />
                            <Property Name="Tooltip" Value="Shows the highscore lists." />
                            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                            <Property Name="UnifiedAreaRect" Value="{{0,2},{0,25},{0,61},{0,69}}" />
                            <Property Name="ClippedByParent" Value="False" />
                        </Window>
                    </Window>
                </Window>
            </Window>
   </Window>
</GUILayout>

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

Postby CrazyEddie » Mon Jan 05, 2009 09:37

Thanks for the report and the layout. We'll need to test this and get back to you, I think it's a potential bug or something, since what you're doing should be correct :)

CE.

Nimos
Just popping in
Just popping in
Posts: 12
Joined: Sun Jan 04, 2009 20:13

Postby Nimos » Sat Jan 17, 2009 17:51

Although not very urgent, but perhaps a ticket should be created on this so it won't be forgotten?

Best Regards
Nimos

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

Postby CrazyEddie » Sat Jan 17, 2009 20:47

Hi,

I have added a ticket, thanks for the reminder :P

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 3 guests