How do you switch screens with a button? I have my home page, and I would like to have a button that transfers you to the actual game. What function should I use to do this? [import]uid: 30901 topic_id: 5720 reply_id: 305720[/import]
Use the Director class…
http://developer.anscamobile.com/code/director-class-10 [import]uid: 9371 topic_id: 5720 reply_id: 19589[/import]
another example
http://developer.anscamobile.com/code/object-oriented-sample-game-framework [import]uid: 12108 topic_id: 5720 reply_id: 19609[/import]
@chiquitabanana101 In short, if you’re not using the Director class (I’m not and haven’t, as it happens) is to place your menu/home screen/etc in one display group and your game in another. You place a button on the menu display group, listen for the tap or touch event and respond by moving the menu display group off screen (or fade it out with alpha, or something) and bring the game display group in. Obviously, just about any transition could be used (switch, slide, fade, complex anims, etc.) The idea being that everything is localised to one display group for one use (menu, game, options, etc.) This becomes much easier if you view your code in an object oriented manner and compartmentalise it by, eg: placing you menu code in one function which returns the menu display group.
m [import]uid: 8271 topic_id: 5720 reply_id: 19692[/import]
One of PeachPellen’s beginner tutorials on Techority.com shows how to do this. [import]uid: 9059 topic_id: 5720 reply_id: 19871[/import]