Jump to content

Spritemanager Animation speed based on layer


krum110487
 Share

Recommended Posts

Hello, I am fairly new to babylonjs, but I found this weird thing where on each layer sprites will run at different speeds.

to see this in action simply change the layermask from LAYER_FG to LAYER_BG.

var spriteManagerPlayer = new BABYLON.SpriteManager("playerManager", "textures/player.png", 2, 64, scene);
	spriteManagerPlayer.layerMask = LAYER_FG;

http://www.babylonjs-playground.com/#CSAVV#1

from playing around with it, it seems the foreground is running 3 times as fast, you can see it demonstrated in this code:

http://www.babylonjs-playground.com/#CSAVV#2

I also noticed that when I leave the tab and come back in chrome they start to get out of sync, but if you stay on the page, they will stay in sync.

is this expected? I am a bit confused as to why this may be.

 

Right now I am experimenting with 2d and 3d plains on different layers, I am also going to be experimenting with renderGroups. So forgive the messy code.

Thanks,

Edited by krum110487
Found new information
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...