Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Preventing the Camera From Moving Beyond Level Boundaries
« previous
next »
Print
Pages: [
1
]
Author
Topic: Preventing the Camera From Moving Beyond Level Boundaries (Read 5122 times)
AbsurdInteractive
2D Toolkit
Newbie
Posts: 16
Preventing the Camera From Moving Beyond Level Boundaries
«
on:
July 31, 2013, 04:26:02 am »
Currently, we have the 2D Toolkit camera centered on the player, but we would like to prevent the camera from moving past the level boundaries, and were wondering what ma be the best way to implement this with 2D toolkit's camera?
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Preventing the Camera From Moving Beyond Level Boundaries
«
Reply #1 on:
July 31, 2013, 10:48:37 am »
It'll be exactly the same as any normal camera. There are little helper functions in tk2dCamera that makes it a bit easier to deal with -
tk2dCamera.ScreenExtents (tk2d 2.1 only) gives you the screen rect. You can use this to decide how far to move the camera before you'll be viewing outside the level boundaries.
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Preventing the Camera From Moving Beyond Level Boundaries