I have a MenuLayer which is replace()'d by the GameViewLayer when the
"Start" menu item is clicked. The hex map and units for my game are
then rendered on the screen.
Resizing the window after this causes the screen to go black.
Resizing the window in the MenuLayer produces the expected behavior,
however: the menu is still visible in the newly-resized window. I
also don't have this problem if I start the game directly with the
GameViewLayer. The GameViewLayer's draw method is still being called,
so I'm guessing there is a problem with the camera reconfiguration on
resize.
I've been digging through the director code, but haven't found
anything that might cause this.
Any thoughts?
*Old Code*
cocos.director.director.init( width=800, height=600,
do_not_scale=True, resizable=True )
scene = cocos.scene.Scene()
scene.add( GameViewLayer() )
cocos.director.director.run( scene )
# resizing the window has no effect on the game view
*New Code*
cocos.director.director.init( width=800, height=600,
do_not_scale=True, resizable=True )
scene = cocos.scene.Scene()
scene.add( MenuLayer() )
cocos.director.director.run( scene )
# resizing the window has no effect on the menu view
class StartGameMenuLayer( cocos.menu.Menu ):
...
def on_start(self):
scene = cocos.scene.Scene()
scene.add( GameViewLayer() )
cocos.director.director.replace( cocos.scenes.transitions.EnvelopeTransition(
scene,
0.2 ) )
# resizing the window after this causes the game view
to no longer
be rendered
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cocos-discuss?hl=en.