1
\$\begingroup\$

I'm developing a game in which the screen layout is different for right and lefty players, so i'll put a button in it to mirror the screen vertically.

For displaying textures and fonts, i use a single scene2D stage with actors and labels. The stage's viewport type is FitViewport.

How can i swap between the right and left layouts? Is there something already done to do it on the viewport-side?

Is it only a matter of switching coordinates from bottom-left to bottom-right? I can do that on the viewport camera, but what about all the textures? How can i change an actor's coordinate system?

Thank you all

\$\endgroup\$
  • \$\begingroup\$ As one example, you could render your scene to an off-screen target then draw that target onto the backbuffer. While drawing, you can simply reverse the X-component of the UV's to mirror it. Also, if you are currently viewing the scene from the "front side" (Z+), move the camera to the "back side" (Z-), instead; geometry appears reversed (probably need to reverse culling). \$\endgroup\$ – Jon Feb 24 '16 at 17:28
  • \$\begingroup\$ Please consider the examples in my comment and add a few specific details regarding any of the mechanics I've mentioned. \$\endgroup\$ – Jon Feb 24 '16 at 17:29
1
\$\begingroup\$

Render your part of scene to frame buffer object, than draw frame buffer textureRegion flipped where you want (buffer.getColorBufferTexture())

\$\endgroup\$
  • \$\begingroup\$ Please provide some more info (an example would be nice) \$\endgroup\$ – Jacob Nov 3 '16 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.