Pete Jones
Pete Jones

Reputation: 21

createjs animation slow on ipad

I've been experimenting with createjs to convert some flash as3 animations to HTML5. everything works fine in desktop browsers, but on an i-pad the animation are considerably slower. Where there are complex vector objects they are so slow as to be unusable. I can speed things up by caching the objects, but the quality of the resulting graphics is poor. Are there any solutions to this problem? Thanks in advance

Pete

Upvotes: 1

Views: 1187

Answers (1)

Daniel Santos
Daniel Santos

Reputation: 15788

take a look on canvas size. after a centain size the mobile vídeo boards cannot accelerate the graphics like pc does.

Tip #4. Watch The Size of Your Canvas

Obviously, the larger the canvas the more costly the drawing operation, but if you’re targeting mobile devices, there are some size limits you must keep in mind.

From Safari Web Content Guide:

The maximum size for a canvas element is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM

So if you want to support Apple’s older hardware, the size of your canvas cannot exceed 2048×1464.

But that’s not all! Even with smaller sizes, you have to keep your canvas’s aspect ratio between ~3/4 and ~4/3. If you step outside those boundaries, webkit seems to switch to a totally different rendering mode splitting the canvas into multiple fixed-size areas and rendering them separately with a noticeable delay between them.

There doesn’t seem to be any documentation on this but I have confirmed this happens on both Chrome and Safari on iOS versions 6.0.1 and 5.1.1.

source http://blog.toggl.com/2013/05/6-performance-tips-for-html-canvas-and-createjs/

Upvotes: 1

Related Questions