Lets say I have a display group (my level) which is 2048 x 1024 pixels in size. I know my view port is 1024x768 pixels.
I’m trying to use Graham Ransom’s Camera.lua file to manage my view into the world. The problem is I’m using touch-drag to move the player. Graham’s camera wants to keep the player centered which doesn’t do well with touch drag.
I’m trying to make it so that it won’t start scrolling the background until you near the bounderies of the viewport.
The problem is I don’t know how to map the various numbers I get back (player.x, player.y, event.x, event.y, etc. to screen
I think it has something to do with contentToLocal() but I’m not all that sure how to do this.
I want to know when the player reaches 80% of the screen width and then scroll the camera under the player (as well as 20% the other way and both up and down).
and then move the camera at the same rate the player is moving keeping the camera positioned at the 80/20 point rather than the center.
Any advice? [import]uid: 19626 topic_id: 23038 reply_id: 323038[/import]