So basically i want to have a proper inventory like minecraft but slightly different. The inventory shows the main items in the game and i want a number to display below showing the amount of resources (even if you have none)
here is the game for reference any questions just ask and i can help
The way I would do this is to decide on a certain order for all the items you can have, and then just have a single array filled with 0s at the start. Whenever you collect an item, the number in the array is increased at whatever position the item is at in the order of items.
Then you just display the items in the item order in the inventory, as well as all the numbers in the array, and each number will correctly map to its respective item. You can probably do this with the Text Sprite extension like @TheJetPack mentioned, which I’m pretty sure lets you draw text on a clear background! If that’s too many sprites, I’m pretty sure someone has made a “draw text on image” block, idk if it’s in base Makecode tho (I use JavaScript which has that function built into base Makecode)
Do you have any projects with examples? I have it as more of a hotbar so the inventory code and extension @MeatballDev linked isn’t exactly what im thinking. I just need to figure out how to make the number display underneath and that number needs to be able to go up when you collect an item.