Pause during a phone call?
#1
Posted 07 June 2012 - 05:30 PM
#2
Posted 07 June 2012 - 05:37 PM
#3
Posted 07 June 2012 - 06:13 PM
You need to check the value of os_is_paused... That will tell you, I believe.
ok... where do I check that at? Noobie here for droid stuff remember!
#4
Posted 07 June 2012 - 10:59 PM
#5
Posted 08 June 2012 - 10:54 AM
Just make a new object called obj_pause or something and use the following codes:
//Create event
pause = false
//Step event
if os_is_paused && !pause {
pause = true
instance_deactivate_all(true)
}
if !os_is_paused && pause
{
pause = false
instance_activate_all()
}
Edited by filulilus, 08 June 2012 - 10:55 AM.
#6
Posted 08 June 2012 - 11:48 AM
So all you should do in the os_is_paused detection is place your game into its paused mode... no need to deactivate instances.
Russell
#7
Posted 08 June 2012 - 12:17 PM
Wouldn't pausing your game BE deactivating instances and place a pause-screen on top of everything?So all you should do in the os_is_paused detection is place your game into its paused mode... no need to deactivate instances.
#8
Posted 08 June 2012 - 12:41 PM
#9
Posted 08 June 2012 - 12:44 PM
//Create event
pause = false
//Step event
if os_is_paused && !pause
{
pause = true
instance_deactivate_all(true)
}
if pause
{
draw_set_halign(fa_center)
draw_set_valign(fa_center)
draw_text(view_wview[0] / 2, view_hview[0] / 2, 'Game is paused!#Press anywhere to continue')
draw_set_halign(fa_left)
draw_set_valign(fa_top)
if mouse_check_button_pressed(mb_left)
{
pause = false
instance_activate_all()
}
}
Edited by filulilus, 08 June 2012 - 12:46 PM.
#10
Posted 08 June 2012 - 12:51 PM
Russell
#11
Posted 08 June 2012 - 04:11 PM
Haven't tried this but it should work (if Nocturnes instructions are correct
).
Just make a new object called obj_pause or something and use the following codes://Create event pause = false //Step event if os_is_paused && !pause { pause = true instance_deactivate_all(true) } if !os_is_paused && pause { pause = false instance_activate_all() }
I don't think at this point in the game I am going to worry too much about it if GMS if supposed to pause it.. but I tried the code and in Windows at least it errored out with
############################################################################################
VMError!! Occurred - Push :: Execution Error - Variable Get os_is_paused
at gml_Object_os_pause_Step_0 (line 2) - if os_is_paused && !pause {
############################################################################################
Self Variables :
100001( pause ) = 0.000000
and on the phone itself it actually froze it up
#12
Posted 08 June 2012 - 04:14 PM
Russell
#13
Posted 08 June 2012 - 04:21 PM
I believe you that it works, I'm just trying to figure out how. Do we get one step worth of code? Or is the code actually executed upon return? I'm just curious how it works.
#14
Posted 08 June 2012 - 04:25 PM
When the call comes in then when we switch as fast as possible to it... Well not just calls but any request from OS to switch away...
Russell
#15
Posted 08 June 2012 - 04:30 PM
Thanks for clarification!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











