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>