jeromeetienne / virtualjoystick.js

a virtual joystick library to emulate a joystick on touch screen in javascript
http://jeromeetienne.github.com/virtualjoystick.js/examples/basic.html
MIT License
417 stars 125 forks source link

Performance tweaks. optionally use CSS transitions. #17

Closed phola closed 10 years ago

phola commented 10 years ago

Firstly, thanks for this!

I've been trying to squeeze out performance gains and made this modification to use CSS transitions where available and if not fallback to normal positioning. In my tests it seems to help and reduces the number of layouts the browser needs to do (see images). Can be enabled/disabled through options.useCssTransform before after

jeromeetienne commented 10 years ago

crazy! i had no clue one people did performance on this :)

jeromeetienne commented 10 years ago

merged, thanks for your contribution!

out of curiosity, in which context do you neeed that much performance ?

phola commented 10 years ago

I'm experimenting with a game and trying to get the frame rate as fast and smooth as possible on low-powered mobile devices. If you are interested I'll let you know when it's ready to test and you can have a look! b.t.w I'm no expert here - this stuff was largely inspired by what I learned from this really useful article and others...