Jump to content

Panda.js pro tips


enpu
 Share

Recommended Posts

I will collect some Panda.js pro tips here.

 

Here is few to start:

 

Screenshot

When using Canvas renderer, really handy way to get screenshot is to type this into console:

game.system.canvas.toDataURL();

Tween fast forward

If you want to fast forward your tween to end:

tween.currentTime = tween.startTime + tween.duration;
Link to comment
Share on other sites

  • 2 weeks later...

New in 1.12

 

Debugging slow framerate.

 

Sometimes, specially when using physics, it's important to see how your game works on slower frame rates.

This can be done using game.System.frameRate, example config:

system: {    frameRate: 30}

Normally objects move using delta time, so if your frame rate drops, objects move in bigger steps, to keep moving speed in sync.

You can adjust game.Timer.minFPS to change when objects start to slow down, so they don't take too big steps (default is 20).

timer: {    minFPS: 40}
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...