Canvas Performance

kanaida

Active Member
Licensed User
Longtime User
Hey guys, I'm experimenting with drawing things on the canvas.

To Draw a single frame seems pretty fast, what I'd like to know is if anyone's tried animation with a canvas and if it seems to generally perform pretty well or if it ends up killing performance on most devices.

As a test I drew my own semi-transparent buttons on a gradient background:

What I mean by animation is something like you might see in a fancy futuristic game menu.The screen shows up, buttons move from left to right into their places, each button after the other from top to bottom. You tap on a button, I make it flash, all other buttons slide left out of view again, the button that was clicked moves to the top and then extended all the way to the right to become a title of the current menu.

During the whole process, a background is scrolling slowly, maybe 2 gradients moving in opposite directions, semi transparent so they blend as they move.

I'm aiming for around ~60fps.

Just wondering what your experiences were in regards to doing lots of stuff at once, because I looked at OpenGL and 5 minutes later my brain hurts :sign0161: (could take forever to get good), and this is from someone familiar with vertecies, surfaces, cameras, lighting, shading, bump mapping, did some 3d modeling etc... just never coded it before.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Depending on the resolution of the screen and images you might struggle to hit 60 fps (which is a pretty ambitious target anyway).
But with buttons etc i think you should be okay.
Maybe write a small test program first with the expected number of images and see what happens.

Sent from my GT-I9000 using Tapatalk 2
 
Upvote 0

kanaida

Active Member
Licensed User
Longtime User
Thanks. Ill post my results... gonna try to make a nice set of simple classes now that b4a 2.0 is out. Hopefully this will allow me to make a light engine for games and pretty looking animated ui's sorta like cool looking game menus.

Sent from my LG-MS840 using Tapatalk 2
 
Upvote 0
Top