Hello, I'm trying to create inventory. I'm using ItemList for this.
I see that people use *.png or *.tex files for each item, when they adding items to ItemList.
I wanted to do something more flexible for items (IMHO It's inefficient for me, to have 100 separated .png files if you have 100 items in your project). I saved few items in one (f.e.) *items.png file, and I created TileSet using Sprite nodes and setting Texture region for each Sprite and I exported all to TileSet.
Next I created scene with ItemList and I wrote this:
onready var itemList = get_node("Panel/ItemList")
onready var items = preload("res://Core/Scenes/Tilesets/Items32x32.tres")
itemList.max_columns = 9
itemList.fixed_icon_size = Vector2(32,32)
itemList.icon_mode = ItemList.ICON_MODE_TOP
itemList.select_mode = ItemList.SELECT_SINGLE
itemList.same_column_width = true
var item = items.tile_get_texture(0) #Spirte with ID=0 from TileSet
itemList.add_item("", item, true)
But when I play scene I have whole *png but scaled to one item slot.
How can I get one tile from TileSet to put it to my ItemList? Or maybe I'm doing something wrong, so what is the best way to store multiple items texture?