Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Change the color of the item names.

Status
Not open for further replies.
In my game I've only 3 elements, they're (id/name): 001/Consumable, 002/Key and 003/Material.

All I need is to change the color of those items that have asigned one of the elements.

exemple:

[Potion] is a consumable item.
[Map] is a key item.
[Black Stone] is a material.

When you are in window_item the color of the word "Potion" will be...RED, the color of the word "Map"... ORANGE and the color of the word "Black Stone"... GREEN for exemple.

I think it's an easy script edit but I don't know how.
 
Look into the draw_item method of Window_Item. In there, check the item's element_set array to see if it contains it. Change the font colour to suit
I'm sure you know how to do all these things ;)
 
search in Window_Item under draw_item for those lines :

Code:
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)

and put the following lines before :

Code:
if item.element_set.include?(1)
  self.contents.font.color = # red color here
elsif item.element_set.include?(2)
  self.contents.font.color = # orange color here
elsif item.element_set.include?(3)
  self.contents.font.color = # green color here
end

and put the line at the bottom after
Code:
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)

Code:
self.contents.font.color = normal_color
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top