bitbrain / braingdx

:video_game: Game jam framework based on libgdx.
Apache License 2.0
83 stars 1 forks source link

Advanced camera zoom options #212

Closed bitbrain closed 4 years ago

bitbrain commented 4 years ago

Motivation

We currently can set the camera zoom via defaultZoomFacor property. However, this is very bad for various reasons:

Solution

Change the zoom API to the following:

setZoom(0.2f, ZoomMode.TO_VALUE);
setZoom(256f, ZoomMode.TO_WIDTH);
setZoom(128f, ZoomMode.TO_HEIGHT);

(by default, setZoom will use TO_VALUE)

bitbrain commented 4 years ago

http://acamara.es/blog/2012/02/keep-screen-aspect-ratio-with-different-resolutions-using-libgdx/