Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Diet Estus |
I am trying to set up a minimap in a 2D game. To do this, I have a Map
scene which has the following structure:
My MapViewport
size is set to 64x64 and my Camera2D
is set to current. The Sprite
node is empty.
What I intend to do was to draw the Viewport's
texture to the Sprite
.
This is the technique recommended in Chapter 21 of Godot Game Engine Development in 24 Hours.
When I add the Map
as a child of my Level
, it works as expected. I see a 64x64 section of the GridContainer
. But when I place the map in my HUD, which is a CanvasLayer
, I see the entire GridContainer
.
Why is this?
I think you should be using a ViewportContainer for your Viewport. (ed: late, I know)
duke_meister | 2018-07-11 05:04
Btw, in the future, please paste the actual code instead of a screenshot, because it’ll make it easier for some of us to, if necessary, recreate your project. Also, there’s a “Godot Game Engine Development in 24 Hours” book? Dang.
Ertain | 2019-02-11 23:45