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\$
2
  • \$\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, 2016 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, 2016 at 17:29

1 Answer 1

1
\$\begingroup\$

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .