Move Camera? Need a taller scene than I have...

Hello,

I just started programming with Corona SDK and I’d like to know what would be the best approach to achieve this effect…

I have a helicopter that responds to touch, when the user touches the screen the helicopter climbs with a force being applied in an upward direction.

I’d like for the view to follow the helicopter so that it stays within the view, which will of course mean that my ‘Ground Elements’ need to move downward and out of view.

Now… I don’t want my helicopter to be centered on the scene and all the objects to move around in the opposite direction, I really just need for all the physics to continue working the way they are, and the “CAMERA” to move…

I hope this makes sense.

Thanks in advance for your input.

There is no way to move the camera itself in Corona, I’m afraid you will have to move all of the objects in your scene to create the illusion that the camera is moving. 

 

Since you have physics involved, the only way for you to do this (afaik) is to put all of the objects into the SAME display group, and then move that group’s y position down once the helicopter reaches a certain height.

 

If your objects are NOT in the same group, the physics interactions may not work correctly once you move objects (the physics engine will think objects are still in their previous position, but they will appear in their new position - someone correct me if this is no longer the case).

Might want to check Caleb’s Perspective library in the Code Exchange, I haven’t had the time to check it out fully yet but seem to remember that working on a basis more similar to a camera/viewport.

Here it is, for reference:

http://developer.coronalabs.com/code/perspective

Thanks! Perspective is just the library I needed!

Works like a charm.

There is no way to move the camera itself in Corona, I’m afraid you will have to move all of the objects in your scene to create the illusion that the camera is moving. 

 

Since you have physics involved, the only way for you to do this (afaik) is to put all of the objects into the SAME display group, and then move that group’s y position down once the helicopter reaches a certain height.

 

If your objects are NOT in the same group, the physics interactions may not work correctly once you move objects (the physics engine will think objects are still in their previous position, but they will appear in their new position - someone correct me if this is no longer the case).

Might want to check Caleb’s Perspective library in the Code Exchange, I haven’t had the time to check it out fully yet but seem to remember that working on a basis more similar to a camera/viewport.

Here it is, for reference:

http://developer.coronalabs.com/code/perspective

Thanks! Perspective is just the library I needed!

Works like a charm.