Page 1 of 1

How do I stop android screen from dimming during gameplay

PostPosted: Mon Jan 30, 2017 8:33 pm
by jeffige
I tried using cranberrygame's power management plugin using something like:

Ball - is on screen > CordovaPowerManagement - Acquire

Ball - is NOT on screen > CordovaPowerManagement - Release

But the screen still dims.

Anyone know how to stop the screen from dimming during gameplay when there is no touch involved during gameplay?

Re: How do I stop android screen from dimming during gamepla

PostPosted: Mon Jan 30, 2017 8:58 pm
by Anonnymitet
Does the browser > focus action work? And let it go off now and then so if doesn't dim the screen.

Never had that problem before as my mobile games always require touch inputs but I guess you are using gyro or something as controls?

Re: How do I stop android screen from dimming during gamepla

PostPosted: Mon Jan 30, 2017 9:12 pm
by jeffige
Anonnymitet wrote:Does the browser > focus action work? And let it go off now and then so if doesn't dim the screen.

Never had that problem before as my mobile games always require touch inputs but I guess you are using gyro or something as controls?


Yeah, there's no touch during gameplay, only need tilt.

I am using @cranberrygame plugin. It only has acquire an release. Not working.

Re: How do I stop android screen from dimming during gamepla

PostPosted: Mon Jan 30, 2017 9:19 pm
by newt
I would just include an is in touch condition to the game.
If you set it to set timescale to zero when not in touch you have an effective pause feature.

Re: How do I stop android screen from dimming during gamepla

PostPosted: Mon Jan 30, 2017 9:26 pm
by jeffige
newt wrote:I would just include an is in touch condition to the game.
If you set it to set timescale to zero when not in touch you have an effective pause feature.


Thanks for the reply, but how do i add an "is in touch" if the user does not have to touch the screen during gameplay?

Not including the Menu, Options and Store, and only during the actual playing of the game, the user only has to roll a ball around the screen. Sometimes it last a few seconds, sometimes minutes.

Re: How do I stop android screen from dimming during gamepla

PostPosted: Mon Jan 30, 2017 9:34 pm
by Anonnymitet
jeffige wrote:
Anonnymitet wrote:Does the browser > focus action work? And let it go off now and then so if doesn't dim the screen.

Never had that problem before as my mobile games always require touch inputs but I guess you are using gyro or something as controls?


Yeah, there's no touch during gameplay, only need tilt.

I am using @cranberrygame plugin. It only has acquire an release. Not working.


I see, but try adding the browser plugin as well and try the focus action. No need changing anything else just use it for the focus action.

Re: How do I stop android screen from dimming during gamepla

PostPosted: Mon Jan 30, 2017 9:42 pm
by jeffige
Anonnymitet wrote:
jeffige wrote:
Anonnymitet wrote:Does the browser > focus action work? And let it go off now and then so if doesn't dim the screen.

Never had that problem before as my mobile games always require touch inputs but I guess you are using gyro or something as controls?


Yeah, there's no touch during gameplay, only need tilt.

I am using @cranberrygame plugin. It only has acquire an release. Not working.


I see, but try adding the browser plugin as well and try the focus action. No need changing anything else just use it for the focus action.



Okay. i'll try that and update soon.

Thanks for the replies.

Re: How do I stop android screen from dimming during gamepla

PostPosted: Mon Jan 30, 2017 9:48 pm
by newt
jeffige wrote:
newt wrote:I would just include an is in touch condition to the game.
If you set it to set timescale to zero when not in touch you have an effective pause feature.


Thanks for the reply, but how do i add an "is in touch" if the user does not have to touch the screen during gameplay?

Not including the Menu, Options and Store, and only during the actual playing of the game, the user only has to roll a ball around the screen. Sometimes it last a few seconds, sometimes minutes.


Im imagining in landscape mode the user placing both thumbs on the bottom corners of the screen.
Like a pinch.