Combine Node2d and Control [with picture]

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

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?

Example:

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

:bust_in_silhouette: Reply From: max.marauder

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 .