What is a viewport?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dany_pitre

Hi !
simple question… what is a viewport? I see this in many tutorials but cant manage to understand it. I checked the documentation, but I dont manage… what is a “different view of the scene” means?

Thanks a lot !!

:bust_in_silhouette: Reply From: stormreaver

Imagine you are a painter, and you are drawing a picture onto your canvas. That canvas would be your Godot viewport.

Now imagine that you are drawing another picture onto a separate canvas. This second canvas is completely independent of the first canvas. This would be another viewport.

You could have a third, a fourth, or a fifth canvas (and more if you so chose). At its heart, that’s all a viewport is: a canvas upon which you can paint a picture. In computing terms, you can think of it as a window. You can show multiple viewports/windows on the same monitor/screen, or you can show different viewports/windows on different monitors/screens.

Ok good I think I get it ! So it’s like a scene but with multiple elements of the game, not only an object?

dany_pitre | 2021-09-20 22:19

If I understand you correctly, then yes.

stormreaver | 2021-09-21 00:45