Camera stopping at edge of tilemap?
by C. N. · in Torque Game Builder · 10/04/2005 (12:17 pm) · 2 replies
Hi,
I've mounted a camera to the player in my top-down rpg. Works great, but I'm curious about how I get the camera to stop scrolling when, say, the bottom of the camera reaches the bottom of the tilemap, or the left edge of camera against the left edge of the tilemap...? Anyone know how this is done?
Thanks for any advice. :)
I've mounted a camera to the player in my top-down rpg. Works great, but I'm curious about how I get the camera to stop scrolling when, say, the bottom of the camera reaches the bottom of the tilemap, or the left edge of camera against the left edge of the tilemap...? Anyone know how this is done?
Thanks for any advice. :)
Torque Owner Johan Stenqvist (neochrome)
You can use the setViewLimitOn() call on fxSceneWindow2D to restrict camera movement withing the limits of your tilemap. Call with coordinates for left, top, right, bottom I think - like this: "-10 -10 10 10" for a tile map of 20 by 20 units.
Cheers,
Johan