Jump to content

Camera zoomed in, bounds added, but the camera can still goes out screen. What should I do?


notalentgeek
 Share

Recommended Posts

These are the codes.

        _Game.camera.scale.x = 4;
        _Game.camera.scale.y = 4;
        _Game.camera.setBoundsToWorld();
        _Game.camera.bounds.height = 576 * _Game.camera.scale.y;
        _Game.camera.bounds.width = 1024 * _Game.camera.scale.x;
        _Game.camera.bounds.x = 0 * _Game.camera.scale.x;
        _Game.camera.bounds.y = 0 * _Game.camera.scale.y;
        _Game.camera.update();
        _Game.camera.y += 2;

My game resolution is 1024 x 576 pixels. The _Game.camera.y += 2 is put in update function, yet the camera can still go out from screen.

Also what is the different between _Game.camera.view.y and _Game.camera.y?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...