libGDX cameras are mostly used for layered rendering with different "world unit size," but I wonder is there a way of showing the view of for example a libGDX Orthographic camera in the corner of screen - lets say showing what a drone's camera sees from ground?

Here's an example:

Image of plane on a runway, with a smaller picture-in-picture view of the same in the corner

How can I achieve such effect?


1 Answer 1


You can render the drones view to a FrameBuffer, and then draw that FrameBuffer onto your main screen.

This is often referred to as render to texture.

FrameBuffers in libGDX

  • \$\begingroup\$ Oh thanks for the answer @bornander. If I'm right I should draw the game twice ;once with the drone camera onto a Frame buffer and then draw that frame buffer on the actual game camera? I'll try this method and inform you the results. \$\endgroup\$
    – CallOfVoid
    Jan 27, 2023 at 10:48
  • \$\begingroup\$ Yes @M-Avoid, that is what I am suggesting. Are you doing 2D or 3D? I might find the time to create an example. \$\endgroup\$
    – bornander
    Jan 27, 2023 at 15:25
  • \$\begingroup\$ I'm sorry for this late reply; I'm trying to do 2d, did the thing and got some nice results as needed,but I may understand the concept for 3d aswell thank you for your effort \$\endgroup\$
    – CallOfVoid
    Apr 12, 2023 at 17:28

You must log in to answer this question.

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