A lot of situations ! lets go by parts
On Fri, Nov 12, 2010 at 2:32 AM, Mike Wyatt <[email protected]> wrote: > 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. > A wild guess is that your scene sets the anchor, scale or something. I think that when growing ScrollingManager the unspoken assumption was that the Scene in which it lives is a stock scene with default values. By example, all the code for coordinate changes assumes the scene scale is 1.0 For that problem, a workaround would be moving any non default value to the layer. With default scene values resize is forking fine, see the last version for test_b0_tiles_scrolling_manager.py at http://code.google.com/p/los-cocos/issues/detail?id=153 Resizing the window in the MenuLayer produces the expected behavior, > however: the menu is still visible in the newly-resized window. I read it as: resizing the menu layer, then replacing with the gameview : the gameview show but the menu also is still showing ? ??? > 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, > create and resize goes well ? > 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 > > what is no effect ? suppose the resize it toward bigger window size. there is more screen area to draw. So, the draw into the window is not the same. For do_not_sale=True, I expect more world area be shown on screen, at the same scale before the resize. for do_not_scale=False, the default, I expect the same world area to be shown, only scaled bigger. Incidentally, the example I mentioned shows that behavior. > *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 > > if you are using do_not_scale=True and don' t do something in the event on_cocos_resize, then I expect: . the window has more area . the menu elements don't change size do_not_scale means that you want to handle explicitly the resizes. For that, you should have somewhere a on_cocos_resize method, and register it as listener for the the *director* event on_cocos_resize > 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 > > There is a bug here, and seems to be related to grid transitions. I modified the b0 example by adding an InitialScene that will transition to the map scene and could repeat the problem (black window if resize after transition). I pastebinded the modified test at http://pastebin.com/KJJ7wtxK Look at the commented out lines in go_other_scenes: seems that all the problematic transitions used grid transitions. I will look at this. In the meantime the only workaround I can think is to use one of the non grid transitions. -- claudio -- 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.
