Draw functions no longer work after resume.
I have an app that I am ready to publish but don't feel comfortable publishing with this issue.
Here is a link to the original post:
http://forum.thegamecreators.com/?m=forum_view&t=213698&b=41
In my app, I continually draw lines and have text display over the top of the drawing. If the app is placed in the background, the text continues to display, but the draw functions no longer work.
I have tried using GetResumed() and attempting to re-initialize the app but nothing seems to work.
I'm using setrendertoscreen () and createsprite(1,1) to leave the lines that have been drawn while I draw new lines.
I have 8 different Android devices that I use to test and they all exhibit this problem. This happens both when I make an apk and test it or when I am broadcasting to the device for test. This has also been tested by BatVink on a couple of other devices with the same result.
If I jump to another app, without closing my app, then return to my app, it returns as a black screen and the draw commands don't work.
Here is some sample code:
deviceX = 1600
deviceY = 900
SetVirtualResolution( deviceX, deviceY )
SetWindowSize( deviceX, deviceY, 1 )
SetOrientationAllowed( 0, 0, 1, 1 )
SetSyncRate(30,0)
clearScreen()
CreateRenderImage (1,deviceX, deviceY,0,0)
while getRawKeyPressed( 27 )= 0
cls = random(1,1000)
if cls > 997 then clearScreen()
if GetResumed() then clearScreen()
X1 = Random(1,deviceX)
X2 = Random(1,deviceX)
Y1 = Random(1,deviceY)
Y2 = Random(1,deviceY)
color1 = 25
color2 = 25
color3 = 25
color4 = 255
DrawBox( X1, Y1, X2, Y2, color1, color2, color3, color4, 1 )
setrendertoscreen ()
createsprite(1,1)
sync()
setRenderToImage (1,0)
endwhile
deleteSprite( 1 )
end