Note that there are some explanatory texts on larger screens.

plurals
  1. POEaselJS - Having two canvases with different FPS
    primarykey
    data
    text
    <p>I am experimenting with EaselJS and 2 animation instances using sprite sheets and 2 separate canvases at different positions with the same z-index, they aren't layered. What I have now are two EaselJS functions each with a different stage and sprite sheet, instance1 being fired with jQuery after DOM load and instance2 with mouseenter/mouseleave events also with jQuery. </p> <p>EaselJS: </p> <pre><code>function instance1() { var stage = new Stage(document.getElementById(canvas1)); var ss = new SpriteSheet({ "images": ["sprite1.jpg"], "frames": {"regY": 0, "height": 100, "regX": 0, "width": 200, "count": 17}, "animations": {"instance1": [0, 16]} }); var initInstance1 = new BitmapAnimation(ss); initInstance1.x = 0; initInstance1.y = 0; initInstance1.gotoAndPlay("instance1"); stage.addChild(initInstance1); Ticker.setFPS(10); Ticker.addListener(stage); } function instance2() { var stage = new Stage(document.getElementById(canvas2)); var ss = new SpriteSheet({ "images": ["sprite2.jpg"], "frames": {"regY": 0, "height": 100, "regX": 0, "width": 200, "count": 17}, "animations": {"instance2": [0, 16]} }); var initInstance2 = new BitmapAnimation(ss); initInstance2.x = 0; initInstance2.y = 0; initInstance2.gotoAndPlay("instance2"); stage.addChild(initInstance2); Ticker.setFPS(24); Ticker.addListener(stage); } </code></pre> <p>While testing, I found that instead of running at the FPS defined by each function, instance1 will run at 10FPS, then if instance2 is called by mouseenter(); with jQuery, instance1's FPS will automatically change instance2's FPS. Is there a method of applying a different Ticker to each instance as to retain separate FPS? Thanks in advance. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload