Question

I want to use Framebuffers in my little libgdx game.

The game uses scene2d and I modify the Stages camera to use a viewport of 50 width and 31 height. Then I set the SpriteBatch's projection matrix to camera.combined. Doing this I have a resolution independent game and I can use my own "WorldUnit" instead of using pixels.

But now, if I create a FrameBuffer, I have to give it a size. Do i have to give it the size of the cameras viewport or the size of the screen in pixels?

And, when I render things to that FrameBuffer, can I render them in WorldUnits, meaning rendering at P(25,16) is almost in the middle of the game window?

Thanks

Was it helpful?

Solution

Its the height and width of the frame which should be buffed. So it should be the viewport height and width if you dont do something fanzy with it. (Same as at the Stage for example)

Just do mention dont forget to add the setSize of the FBO to the resize method of your Scene2D.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top