Is there a way to draw an icon from a database entry?

Like if I wanted an item/skill/weapon description to feature an icon in it.

Can I do this somehow?
Are you talking about in a Show Text box? If you hover your mouse over the panel where you enter text, the control codes will appear.


\i[15] will show the 15th icon. When you're assigning an icon to a weapon or something, you can click on the icon, and in the lower left(?) corner of that window, the icon index will appear. That's the number you want to use.
Are you talking about in a Show Text box? If you hover your mouse over the panel where you enter text, the control codes will appear.

\i[15] will show the 15th icon. When you're assigning an icon to a weapon or something, you can click on the icon, and in the lower left(?) corner of that window, the icon index will appear. That's the number you want to use.
No I mean...

9maxisN.jpg


In that box.
No, you would require a script mod for that. You do realize that when you add an icon to an item, it already displays the icon in the menu? You don't have to add it in the description as well.


Actually, I lie. I just tested it, and you can, indeed, put icons into the description field. Just type it in exactly the same format \i[n] where n is the icon index. When you're in the menu and you have the item highlighted, the description will have the icon.
No, you would require a script mod for that. You do realize that when you add an icon to an item, it already displays the icon in the menu? You don't have to add it in the description as well.

Actually, I lie. I just tested it, and you can, indeed, put icons into the description field. Just type it in exactly the same format \i[n] where n is the icon index. When you're in the menu and you have the item highlighted, the description will have the icon.
Well, it seems to indeed work for description fields...

6KPp4XW.jpg


But...

COy7SmG.jpg


It does not seem to work for fields like this. Is there some way I could get these sorts of fields to work?
In Window_Command, find the draw_item method (mine is on about line 115).


Comment out the draw_text line, and add in the following line instead:

draw_text_ex(item_rect_for_text(index).x, item_rect_for_text(index).y, command_name(index))Unfortunately, those options in the Terms tab have a limited size, so you may not be able to enter a 3-digit icon code. You might need to change the Window_TitleCommand script to actually use the text and icon you want to show, instead of looking up Vocab:: to get the text.
The arguments for draw_text and draw_text_ex are different too. If you use draw_text_ex (which is needed for the icons), you can't tell it to right or center align. You would have to manually calculate where you want the text to begin.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-draw-an-icon-from-a-database-entry.16775/