AndEngine Tutorials
Contact me!
  • Blog
  • Tutorials
  • Devices Library
  • Newsletter
  • Download
  • Contact
  • My Work
  • About me

Setting Camera bounds:


This is really useful feature, mostly for all kind of games, while updating camera center position (while for example chasing player`s position) to do it, we need to use BoundCamera class or its extensions to be able to access methods responsible for setting camera bounds.

1. Setting camera`s bounds:

All we have to do, is to use two methods:
camera.setBounds(0, 0, 2000, 780);
camera.setBoundsEnabled(true);
First two parameter are minimal X and Y bound position (in this case bottom left corner) Two next are maximum bound position. Which means camera`s position will not exceed 2000 x and 780 y value.


HTML Comment Box is loading comments...
Powered by Create your own unique website with customizable templates.