Jump to content

transition between 2 scenes


Phempt
 Share

Recommended Posts

Hi @Phempt

 

I use the fader plugin, but that only does fade in/out.

 

Someone, please correct me if I'm wrong, but I think the only way to do what you want, is to create your levels in the same scene (on different layers) then slide one layer away.

 

In your case, create the menu on a separate layer and slide it away to play your game.

 

Hope this helps :)

Link to comment
Share on other sites

It's really easy :)

 

All you have to do is to copy fader.js into scr/plugins

 

and then ...

 

var fader = new game.Fader({color: 0xffffff, speed: 1000});

fader.fadeIn();
 
or
 
fader.fadeOut();
 
and to switch to a different level, once the fadeOut is complete ...
 
fader.fadeOut(function() {
    game.system.setScene('myLevel');
});
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...