0 votes

I want to make a inventory system. I will make it with control nodes like GridContainer or ItemList. But I also want to make a preview of the player, like in many games (see example below). But if I add a instance of the player to my inventory this would not work well, because it is a Node2d and if the screensize changes, the Node2d will not scale like the Control and it would look bad.

How can I add a preview of the player (Node2d) to my Inventory,
which is made with control nodes?


Here you can see a preview of the player in the top left hand corner.

in Engine by (286 points)

1 Answer

0 votes

You can create a scene with a Control root node (e.g. let's call it PlayerBox), put your Node2D inside as a child, and on its resized signal update Node2d's position and scale according to rect_size of the PlayerBox .

by (32 points)
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 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 webmaster@godotengine.org with your username.