Game pauses before CreateActor
Posted: Thu Sep 15, 2011 6:23 pm
Hello there, yet once again.
The game I'm working on is coming along fairly nicely, however, when working on menus and the pause/resume functionality, I noticed something peculiar.
The following code snippet is inside an actor in charge of creating a black screen when the game is in pause, however it would seem that the CreateActor function is not "fast enough", as the screen_blackscreen actor never appears to be created, or is simply not displayed (The game pauses/unpauses without it). Is it due to the way it works, or is it something else? What I was thinking is, CreateActor waits for the next frame draw to actually create the actor, as this never happens because the game is paused immediately after, it's never done. Can someone confirm this?
The game I'm working on is coming along fairly nicely, however, when working on menus and the pause/resume functionality, I noticed something peculiar.
- Code: Select all
damageIndex = ~damageIndex; //Bitwise complement on damageIndex, but tilde won't show >:(
if(damageIndex)
{
warpModeVar = ~warpModeVar; //Bitwise complement
CreateActor("screen_blackscreen", "screen_black640", "view", "(none)", 320, 240, false);
PauseGameOn();
}
else
{
warpModeVar = ~warpModeVar; //Bitwise complement
DestroyActor("screen_blackscreen");
PauseGameOff();
}
The following code snippet is inside an actor in charge of creating a black screen when the game is in pause, however it would seem that the CreateActor function is not "fast enough", as the screen_blackscreen actor never appears to be created, or is simply not displayed (The game pauses/unpauses without it). Is it due to the way it works, or is it something else? What I was thinking is, CreateActor waits for the next frame draw to actually create the actor, as this never happens because the game is paused immediately after, it's never done. Can someone confirm this?