I have a two level game that has level-1 as scrollable background that spans about 8 landscape screens (width=480*8, height=320). I have implemented it via tiled approach by stitching eight tiles of 480x320 images together. The scrolling works perfect. This level has some sprites and when I tap on anyone of them, I goto the next level. The problem happens when I hit the back button and come back to level-1. When level-1 gets reloaded, it always goes back to the leftmost tile at x=0,y=0.
I noted a few observations:
- I am using self.view as the group carrying the tiles. If I set self.view.x = <some_value> in scene:createScene function, it has no effect. The level-1 goes back to the leftmost tile at x=0,y=0.
2) If I set self.view.x = <some_value> in scene:enterScene function, the scene scrolls to the right location. But the issue is that this creates a jerk, with scene loaded at x=0, y=0 and then scrolling fast to <some_value>.
3) I removed the default self.view display group and instead loaded the entire level into a locally defined display group (local foo = display.newGroup()). Now the level-1 loads fine and the scene is loaded at the right <some_value> location. But this approach runs into trouble with default scene transition animations provided by corona like crossFade(apparently they work only with self.view display group).
So, will some one tell me what approach to take so that:
1) my scene is loaded showing the correct location (should not load at x=0,y=0, but to my provided self.view.x = <some_value> in the createScene function)
2) if I do away with self.view group and use my own display group (see 3), then how to implement scene transition effect like cross fade.
[import]uid: 91950 topic_id: 34722 reply_id: 334722[/import] </some_value></some_value></some_value></some_value></some_value>