0 votes

For turn based battles I was considering making something like this:

enter image description here
but in 3d, with smaller and transparent UI so that the scene can be seen underneath it, basically the 3d scene covers the entire screen and is only in part covered by the ui.

The problem is that the vanishing point(to put it simple the center of the perspective) isn't at the center of the screen, is it possible to do the same in 3d?

the screen is from one of the Ishar games

Godot version 3.2.4 beta 6
in Engine by (203 points)

1 Answer

+1 vote
Best answer

You can do that, and much more, using Viewports and the related ViewportCointainer.

Edit: It should be as simple as placing the ViewportContainer at the desired location, using anchors or margins, and putting the Viewport as its direct child.

by (2,634 points)
edited by

I was alrady using Viewports, but you "forced" me to make more experiments and i found a solution, but not a good one in my opinion because it sounds very expensive, basically i make the Viewport larger than the screen and then i use it as a texture of a sprite with a region as big as the screen to show only the part of the viewport i'm interested.

If you have better solution i'm happy to hear, i tried using Viewport.canvas_transform but with no results.

Just to be clear i quickly made these images:
enter image description here
-the first image is a corridor full screen with the vanishing point at the center

-the second image is exactly like the ishar image i posted, the corridor is resized to fit a smaller window and the blue area is the ui

-the third image is what i wanted, the corridor is fullscreen but with a shifted vanishing point and the ui that only in part covers the corridor.

Maybe there's a way i ignore but with they way you suggest i can only get the second result, while what i want, and got with my method, is the third

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.