0 votes

I started to make a simple inventory system. My Scenetree looks like this:

Inventory(Node2d)
--Control
----ItemList

And I have a Code, which is attached to the Inventory(Node2d):

func _ready():
#At first, I add ten items to my Inventory:
for i in 10:        
    $Control/ItemList.add_item("",load("res://Sprites/Blume1.png"),true)

func _on_ItemList_item_selected(index):  
    #Here I try to attach the selected Item to my cursor:
    var ItemSelected = $Control/ItemList.get_item_icon(index)
    Input.set_custom_mouse_cursor(ItemSelected)
    $Control/ItemList.remove_item(index)

My problems are:
1. When I select a Item and attach it to the cursor and remove it from the ItemList, I want that there, where the Item was before, is a gab. But actually, the other Items are moving to the left and top, so that there is no gab anymore.
2. The size of the custom mouse courser is very small. How can I incress the size of the custom coursor?

in Engine by (322 points)
edited by

1 Answer

0 votes
Best answer

When I select a Item [...] from the ItemList, I want that there, where the Item was before, is a gab.

You'll have to code this yourself, something like this should work:

$Control/ItemList.set_item_icon(index, load("res://transparent.png")
$Control/ItemList.set_item_disabled(index, true)

The size of the custom mouse courser is very small.

The mouse cursor size is capped at 250 x 250 pixels. If your cursor is smaller than that, just use a bigger texture and the cursor will become bigger as well.

by (10,221 points)
selected by
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.