libgdx/libgdx — pull request #1504 by nooone (2014-03-20 12:47:53+00:00)
Title: Viewports

I'm not sure whether I'm doing those PRs correctly or not, because somehow it seems like I'm always replacing whole files, but well, I'm new to git still...

I have written a little wiki page about the Viewports I've implemented. https://github.com/libgdx/libgdx/wiki/Viewports

There are also some tests. Every viewport now manages a camera. Mostly this was done to keep backwards compatibility and not break any API. I only had to add one more method to Stage which just sets the viewport parameters.

I like how it works now, the only thing I don't like is the automatic position change of the camera when Viewport.update() is called. This might be removed and be done manually instead, keeping it more clean in total (Viewport wouldn't do anything but implement a scaling strategy in this case), but it also means it's less comfortable to use.

Having that said, all changes are completely additionally. This doesn't "cleanup" the API, like I planned it initially, but it also doesn't break any core stuff...