[resolved] creating menu system for a game
Posted: Sat Jun 09, 2007 21:09
Hey ive got a couple of questions
im creating a menu for a uni project i currently use the demo7 as the base code
ive created about 8 full windows inside the layout xml document each window contains different buttons and text areas some contain pictures and other widget thingys
question 1
whats the most efficent way of swapping menu windows currently i set all except 1 menu as invisible on startup then switch the new menu to visible and the previous to invisible would it be better to have only one window and somehow dynamically create the buttons and text areas from a file with new content or load all at the start as it is currently and use setVisible
question 2
is there a way to set a global subscribe event to the root window so i dont have to create seperate event calls for every single button im currently using code from the forums for event calls or at the very least create an event call one level higher than the button so it handles all the buttons for that menu window
this is the forum posts i found the single function event handler code from
http://www.cegui.org.uk/phpBB2/viewtopi ... ght=button
and
http://www.cegui.org.uk/wiki/index.php/ ... e_Callback
but these only confine the event calls to one function they dont fix the problem of having to set the same event to every single button
this is a problem because i have about 25 buttons in total
any help is appreciated thankyou
im creating a menu for a uni project i currently use the demo7 as the base code
ive created about 8 full windows inside the layout xml document each window contains different buttons and text areas some contain pictures and other widget thingys
question 1
whats the most efficent way of swapping menu windows currently i set all except 1 menu as invisible on startup then switch the new menu to visible and the previous to invisible would it be better to have only one window and somehow dynamically create the buttons and text areas from a file with new content or load all at the start as it is currently and use setVisible
question 2
is there a way to set a global subscribe event to the root window so i dont have to create seperate event calls for every single button im currently using code from the forums for event calls or at the very least create an event call one level higher than the button so it handles all the buttons for that menu window
this is the forum posts i found the single function event handler code from
http://www.cegui.org.uk/phpBB2/viewtopi ... ght=button
and
http://www.cegui.org.uk/wiki/index.php/ ... e_Callback
but these only confine the event calls to one function they dont fix the problem of having to set the same event to every single button
this is a problem because i have about 25 buttons in total
any help is appreciated thankyou