Sam

Phaser easing effects - List

Recommended Posts

Maybe I'm blind ;) but is there anywhere a list of available easing effect of Phaser?
such like:
 

game.add.tween(this.pauseMenuBTNcancel).to({y:game.height - 200},0, Phaser.Easing.Bounce.Out, true);

cheers ;)

Share this post


Link to post
Share on other sites

Easing doesn't work like that. All easing does is change how a value is changed over time, it doesn't actually matter what value you apply it to. You could easily apply say a Quadratic.InOut to the angle value of a sprite and get it to smoothly start rotating, then slow down gradually to a stop.

var ball = game.add.sprite(game.world.centerX, game.world.centerY, 'ball');// This will make the ball turn upside down over 3 seconds, gradually speeding up and then slowing down againgame.add.tween(ball).to({angle: 180}, 3000, Phaser.Easing.Quadratic.InOut, true);

Share this post


Link to post
Share on other sites

I was going threw the phaser examples and I saw 

game.add.tween(text).to( { alpha: 1 }, 2000, "Linear", true); 

When try to use it Phaser gives me an error for  "Linear"  string. Since small investigation I found this in the docs. It contains all the

easings, so the correct code was  

game.add.tween(text).to( { alpha: 1 }, 2000, Phaser.Easing.Linear.None, true); 

Hope this is helpfull

 

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.