2D Toolkit Forum

2D Toolkit => Support => Topic started by: geovizz on April 24, 2017, 03:06:28 pm

Title: tk2dCamera ZoomFactor issue
Post by: geovizz on April 24, 2017, 03:06:28 pm
Goal: Make x1-xn camera zoom to reach pixel perfect camera scale.

What i do:

Code: [Select]

float zoomFactor = 3f;
Rect rect = new Rect(0.25f,0.25f, 0.75f,0.75f); // pseudo-values for example

_gameplayCamera.CameraSettings.rect = rect;
_gameplayCamera.ZoomFactor = zoomFactor ;

Result: Everything works as i expect in Unity Editor:

(http://www.theshpufa.com/issues/editor.png)

Issue: Hovewer, it doesn't work when i run game build. Any ZoomFactor looks same - upscaled to fit screen.

(http://www.theshpufa.com/issues/app.png)

All overrides for camera switched off:

(http://www.theshpufa.com/issues/camera.png)

IMPORTANT NOTE:

The issue only appears when i change _gameplayCamera.CameraSettings.rect

Any thoughts what it is?

Title: Re: tk2dCamera ZoomFactor issue
Post by: unikronsoftware on May 24, 2017, 11:23:26 pm
I am just following up to the email I responded to - what version of Unity are you using, and is this still an issue for you?