GLBasic forum

Main forum => GLBasic - en => Topic started by: msx on 2011-Jun-25

Title: Energy savings
Post by: msx on 2011-Jun-25
During an animation after a while the screen switches to energy savings and reduces the intensity of light, how can I prevent that?.
Title: Re: Energy savings
Post by: MrTAToad on 2011-Jun-25
Which platform ?
Title: Re: Energy savings
Post by: msx on 2011-Jun-25
iPhone.
Title: Re: Energy savings
Post by: matchy on 2011-Jun-25
I presume it is the iOS screen saver kicking in that requires a touch screen to wake up.

Unless there might be a command (such as NET..) to trigger it, perhaps iPhonePumpEvents and / or some wake up / touch screen refresh call ObjC function?

Title: Re: Energy savings
Post by: msx on 2011-Jun-26
The problem is that if during the animation, we touch the screen to wake up, cause the end of the animation as well.

Would be nice if there was a command to wake up.
Title: Re: Energy savings
Post by: Kitty Hello on 2011-Jun-27
Code (glbasic) Select

?IFDEF IPHONE
IMPORT "C" void iPhoneKeepAwake(int bKeep)
?ENDIF


That should work as a GLBasic function then.
Title: Re: Energy savings
Post by: msx on 2011-Jun-28
I do not understand how I can use that code to awaken the iPhone.  :(
Title: Re: Energy savings
Post by: Kitty Hello on 2011-Jun-28
uhm... just call
iPhoneKeepAwake(TRUE) somewhere in your code. It will disable the auto-standby as long as your app runs then.
Title: Re: Energy savings
Post by: msx on 2011-Jun-28
as always ... Thanks Gernot.  :nw:
Title: Re: Energy savings
Post by: Mikele on 2011-Oct-08
Hey!

How to do that on Android device?

Btw. it's my first post here so... Hello! GLB really rocks!
Title: Re: Energy savings
Post by: spacefractal on 2011-Oct-08
Actuelly I have seen that game in a Western shooter too, where the lockscreen conflicted Animation, so its just skipped when you unlock again. That is pretty much very annoying, and hence I dont really like when it happens.

So if you ask me, either disable with code, but remember to enable again when animation is ended (screen should allways lock when not used, but could do that when animation is ended). Alternative you could do two finger touch close (or one finger holding a least 1 secs around space spot).....

Title: Re: Energy savings
Post by: ampos on 2011-Oct-30
Quote from: Mikele on 2011-Oct-08
Hey!

How to do that on Android device?

Btw. it's my first post here so... Hello! GLB really rocks!

I would like to know it too...
Title: Re: Energy savings
Post by: ampos on 2011-Oct-31
I have found

Code (glbasic) Select
android:keepScreenOn="true"

but I don't know where it should be... I have made a few test with no luck...

http://jtomlinson.blogspot.com/2009/03/i-want-to-keep-screen-on.html

http://developer.android.com/reference/android/view/View.html#attr_android:keepScreenOn