Viewport less than screen

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

Hi all,

I am trying to plan a game similar to Eye of the Beholder / Might and Magic (XEEN) using godot. Is it possible to have the viewport of the main game (probably a 3d view) less than the screen and have the rest of the screen an image?

Will this be a UI layer or an actual graphics mask layer?

:bust_in_silhouette: Reply From: brokenjava

TLDR; yes. .

:bust_in_silhouette: Reply From: njamster

Yes. Start by creating a new scene, select a Control-node as root and adjust its rect_size-property to your screensize (best done via Layout > Full Rect). Next add a ColorRect as a child and let it fill the full screen as well. Now add another child-node: a ViewportContainer, having a child on it’s own: a Viewport. Set the stretch-property of the ViewportContainer to trueand adjust it’s rect_size-property to your liking, the Viewport will adopt that size. Finally add any 2D-node or 3D-node as a child of the Viewport. They should only be rendered in the area you setup earlier.

Is there a visual help for this, sounds promising (I reasked the question a couple of minutes ago stating the similarity to EOB game style)…

I’ll try to reproduce what you say at first. Expect probably questions :slight_smile:

Regards,
Panos

Panagiotis Halatsako | 2020-02-19 14:27

1 Like