Open GoogleCodeExporter opened 8 years ago
So here's what I've done to test this... and maybe this is something completely
retarded that I'm leaving out. I'm using the 2.0.3 rokon jar for my project.
I've dropped my code to be one simple scene that has a background. And this
still doesn't wake back up properly. My RokonActivity looks like this :
public void onCreate() {
debugMode();
forceFullscreen();
forceLandscape();
GAME_WIDTH = setGameSize(GAME_WIDTH, GAME_HEIGHT);
setDrawPriority(DrawPriority.PRIORITY_NORMAL);
setGraphicsPath("graphics/");
createEngine();
}
@Override public void onLoadComplete() {
Textures.loadTextures();
menuScene = new MenuScene();
setScene(menuScene);
}
My MenuScene looks like this :
public MenuScene() {
superr(1, 5); // Setup the scene to have 1 layer of sprites.
// (note that the background does NOT count as a sprite)
transTo = -1;
scene = null;
}
@Override public void onGameLoop() {
// I just left some random code here otherwise it wouldn't start up.
if (transTo > -1) {
boolean doTrans = false;
switch (transTo) {
case 1: // game mode
break;
case 2: // instructions mode
break;
case 4: // high scores
break;
}
if (doTrans) {
transTo = -1;
logoSprite.hide();
}
}
}
@Override public void onPause() {
}
@Override public void onResume() {
}
@Override public void onReady() {
Textures.loadTextures();
setBackground(menuBackground = new FixedBackground(Textures.menuBackground));
}
Any ideas? This is as basic as it gets using Rokon. Is this something the
engine is doing or something I am leaving out?
Original comment by PPro.Gam...@gmail.com
on 27 Nov 2010 at 2:07
Ok so here is the problem that I am seeing after some debugging. When I come
back from onDestroy onResume is called. At that point my Rokon activity has
the same id# as it had when it first ended. Then, for some reason, a second
onResume is called. That second onResume is showing that the RokonActivity's
id has changed. I'm assuming that means a new Rokon activity is created. How
am I supposed to be handling this in the onPause and onResumes of the
individual scenes?
Original comment by PPro.Gam...@gmail.com
on 28 Nov 2010 at 6:36
Ignore this. I was being stupid and wasn't reloading my textures in the
onResume of each scene.
Original comment by PPro.Gam...@gmail.com
on 2 Dec 2010 at 11:53
Original issue reported on code.google.com by
PPro.Gam...@gmail.com
on 25 Nov 2010 at 8:11