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.

need help showing bad status icon instead of text

Status
Not open for further replies.

KAIRE

Member

^
i want to show icons for status such as poison, silence, etc. instead of the normal default TEXT. how can i show icons instead of text?
 
Just put this above main in a new script window.
Code:
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Make State Text String for Drawing
  #     actor       : actor
  #     width       : draw spot width
  #     need_normal : Whether or not [normal] is needed (true / false)
  #--------------------------------------------------------------------------
  def make_battler_state_text(battler, width, need_normal)
    # Make text string for state names
    text = []
    for states in battler.states
      unless $data_states[states].rating == 0
        next if states == nil
        text << $data_states[states].name
      end
    end
    # Return completed text string
    state_text = text.size == 0 ? "" : text
    return state_text
  end
  #--------------------------------------------------------------------------
  # * Draw State
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 120)
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
    for i in text
      self.contents.blt(x + text.index(i) * 32, y, RPG::Cache.icon(i), Rect.new(0, 0, 32, 32))
    end
  end
end

Put the icons in the icon folder of your game and name them like you named your states.
 
Look into the download manager. I think ccoa has made some.

This topic has been resolved. If KAIRE or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
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