-
Hi everyone,
Here is my code: _gameCamera = new FlxCamera(0, 0, FlxG.width, FlxG.height);
_cameraUI = new FlxCamera(0, 0, FlxG.width, FlxG.height);
_gameCamera.bgColor = FlxColor.BLACK;
_cameraUI.bgColor = FlxColor.TRANSPARENT;
CAMERA_SCALE = 1.6;
_gameCamera.zoom = CAMERA_SCALE;
FlxG.cameras.reset(_gameCamera);
FlxG.cameras.add(_cameraUI);
FlxCamera.defaultCameras = [_gameCamera]; //zoom works
//FlxG.cameras.setDefaultDrawTarget(_gameCamera, true); //zoom doesn't work The instruction: The instruction: The only way for the zoom to work is using the old deprecated command, any idea why is that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
@Lbones-ai, the problem may be that you're adding _cameraUI as a defaultDraw camera, too, so it's drawing everything at zoom:1.0 after/on top of the _gameCamera, try the following and setDefaultDrawTarget should work as expected. FlxG.cameras.add(_cameraUI, false); Also, you shouldn't need to even call |
Beta Was this translation helpful? Give feedback.
@Lbones-ai, the problem may be that you're adding _cameraUI as a defaultDraw camera, too, so it's drawing everything at zoom:1.0 after/on top of the _gameCamera, try the following and setDefaultDrawTarget should work as expected.
Also, you shouldn't need to even call
setDefaultDrawTarget(_gameCamera, true);
asreset(_gameCamera)
will set it as a default draw target