Jump to content

Pointers seems to be very expensive in mobile


goyeneche
 Share

Recommended Posts

In my game if you touch the screen and then move the pointer, the fps drops from 60fps to 35-40fps. ( tested in galaxy s3 mini )

 

And has nothing to do with my code, if I try this example: http://phaser.io/examples/v2/input/multi-touch

The highest fps I get it's 50 without doing anything ( CANVAS mode )

Moving 1 pointer : 30-35fps

Moving 2 pointers: 25-30fps.

 

Pointers are very usefull, but they seem to be slooow. Is there anyway to optimize this? or at least replace the pointers with something else? I have a virtual gamepad to move a spaceship and a button to shoot. 

Thanks

Link to comment
Share on other sites

Which browser are you testing in on the S3 mini? And which version of Android?

I am using a webview with Cordova, I have Android 4.1.2

 

 

Phaser does a lot of extra processing when there's input.  Depending on what your app does, you could try disabling input processing on everything that doesn't need it, that might help.

Do you mean inputEnabled = false; ?

Link to comment
Share on other sites

Yes, inputEnabled = false, I think that's it.  I noticed a slowdown on touching once and had lots of inputs enabled on sprites with ellipse hit areas, it really chugged testing everything to see if the pointer was in all those the hit areas.

Link to comment
Share on other sites

Yes, inputEnabled = false, I think that's it.  I noticed a slowdown on touching once and had lots of inputs enabled on sprites with ellipse hit areas, it really chugged testing everything to see if the pointer was in all those the hit areas.

I 'll check this, thanks

Link to comment
Share on other sites

Android pre-4.2 (I think 4.2.2 was the magic number) was notorious for being terrible all over the place, I hope you find a solution but we found back then that you'd get a solution (read, hack) that seemed to fix your problem 99% of the time (no idea why not 100% but sometimes things just went crazy) but there would be one or two devices that would act differently, often to the point of being nearly unusable.

 

Thankfully things are far easier now for Android, slowly approaching the point where developing web stuff targeting that platform is 'fun'.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...