AS3 Camera (0)
June 7th, 2009 by terrypaton, under Library.
This is my first go at setting up a reusable camera class so it may need a bit of tweaking when used in a real situation.
Setup a camera, giving it x,y, render window width and height, zoom, a maximum zoom value, and constraints. The camera will then keep the bitmap edges within the render window frame regardless of the zoom (it works out the furthest you can zoom out based on the constraints you give it, but you can make you maximum zoom whatever you like.
This camera class needs to work with a rendering system to support it, which I have in the main class.
I have used my ‘landscape generator‘ code to make the map for this, but it’s very easlily adapted to using a library bitmap.





