I retrieve the icon index like this:
console.log($dataWeapons[1].iconIndex);But then I also have to store the info somehow. Like I have to store it like "You found a item[1]!" And then I have to cut the string into 2, put an icon in between and print it out on the window somehow. This must be build-in somewhere. How do I properly display the icon and the name of the item/weapon/armor/whatever on the window? Including knowing the offset for drawing additional text or lines.
I currently implemented it as an object with 3 variables (text1, iconindex, text2) and when drawing I manually calculate the positions of the text with measureTextWidth() and such. It works but it looks so messy.
console.log($dataWeapons[1].iconIndex);But then I also have to store the info somehow. Like I have to store it like "You found a item[1]!" And then I have to cut the string into 2, put an icon in between and print it out on the window somehow. This must be build-in somewhere. How do I properly display the icon and the name of the item/weapon/armor/whatever on the window? Including knowing the offset for drawing additional text or lines.
I currently implemented it as an object with 3 variables (text1, iconindex, text2) and when drawing I manually calculate the positions of the text with measureTextWidth() and such. It works but it looks so messy.