2

folks ;)

Im doing a basic animation with box2dweb and kineticjs. Both frameworks are awesome. This is a preview of what im doing: http://lab.devgf.com/boxkinetic/index_v.htm

When I see it in Google Chrome or Safari (desktop) it works really nice. Up to 60 fps. When I load this page with iPad's Safari the problem beggins.

If i use an iPad mini or iPad 2 (or even iPad 1) it works with an "acceptable" speed. Even inside Adobe DPS. BUT if the iPad is a retina model, (or with iPhone 5) there is NO speed. It is terrible, looks like "freeze".

Could someone help me? What should i do to get a nice framerate (or a different approach inside KineticJS loop) to make it works as it does inside desktop or no retina display device?

The main code to box2dweb im using is on this file: http://lab.devgf.com/boxkinetic/js/tgf/gfbox2d.js

The main code to KineticJS is here: http://lab.devgf.com/boxkinetic/js/Main.js

Any help is apprecciate.

Thank you.

ppalmeida
  • 2,924
  • 5
  • 20
  • 25
  • 1
    Your link to your JS file is missing – Mark May 01 '13 at 12:09
  • looking at your source code on the preview, it seems that you have a lot of layers in the init() function, and with each step(), each layer gets redrawn, this is the main culprit of the slowdown on mobile devices. – SoluableNonagon May 01 '13 at 14:03
  • Oh, @Mark. Sorry the broked link: http://lab.devgf.com/boxkinetic/js/Main.js. EliteOctagon: yes, there is on layer to each square/ball in the screen. But it updates correctly in "no retina" iPads. I will try to do all in the same layer and see what happens. – ppalmeida May 02 '13 at 14:58
  • I admit I'm plugging my own similar question, but this could be a partial duplicate of http://stackoverflow.com/questions/15925958/phonegap-games-canvas-and-slow-javascript. A quick search indicates box2dweb can behave very oddly in mobile enviroments. – SColvin May 07 '13 at 13:39
  • Hi all. The problem was the Kinetic.js. Im moving absolute div elements and with a good performance even on iPad 1 using box2dweb. Now, why Kinetic.js was breaking up i cant say. And yes, i try use only one layer. IMHO it is Apple's horrible canvas implementation on iPad Safari. (Desktop also. Chrome is muuuch more faster). – ppalmeida May 10 '13 at 16:30

0 Answers0