Best way to pan vertically?

In my landscape oriented game, the player launches projectiles with a catapult at targets on the main screen.   Since some projectiles go a bit off the top of the screen (worse on Android than iOS), I would like to pan to follow them.   I can easily move the main display group to accomplish this, and it looks pretty smooth, except the background is part of the group and some shots pan past the end, so I get the dreaded black bar at the top.   

I can think of three ways to address this:

  1. Do nothing and live with the bar

  2. Move the background to its own group and don’t pan (or pan less)

  3. Make the background large enough to eliminate the bar when panning

My background images are currently rendered at 570x380.   if I go with 3), what would be a good size to cover most devices?

I’m going to experiment with 2) and pan less, as panning less seems to be a more realistic approach.

You might want to take a look at this:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Might help with some size ideas.

Thanks, I’ve seen that, and will try to incorporate into a future release.   My 570x380 seems to work OK in the meantime.

On the pan problem, there are only a subset of projectiles I really care about, namely those that are activated by a screen touch to spawn more projectiles.   I’ve added a transition in and out to scroll down a fixed amount of pixels for only these projectiles, and it seems to work pretty well.   

Update:  The best I’ve been able to come up with is to pan group.x, group.y to 25, 25 and xScale and yScale to 0.9.   After a few hundred milliseconds, I transition them back to 0, 0, and 1.0.   

Looks fairly smooth and serves the intended purpose, namely maintaining visibility of objects that prior had to be activated with a touch while off screen.   No black bars on iPhone or Android so far during testing.

Should be out in Goody Cubes 3.3 shortly.

You might want to take a look at this:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Might help with some size ideas.

Thanks, I’ve seen that, and will try to incorporate into a future release.   My 570x380 seems to work OK in the meantime.

On the pan problem, there are only a subset of projectiles I really care about, namely those that are activated by a screen touch to spawn more projectiles.   I’ve added a transition in and out to scroll down a fixed amount of pixels for only these projectiles, and it seems to work pretty well.   

Update:  The best I’ve been able to come up with is to pan group.x, group.y to 25, 25 and xScale and yScale to 0.9.   After a few hundred milliseconds, I transition them back to 0, 0, and 1.0.   

Looks fairly smooth and serves the intended purpose, namely maintaining visibility of objects that prior had to be activated with a touch while off screen.   No black bars on iPhone or Android so far during testing.

Should be out in Goody Cubes 3.3 shortly.