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.

Face graphic in menu

Status
Not open for further replies.
Hi, i recently requested a script on the request forum, none answered so i started to poke around in it a little myself, found out that it would not be too hard to create the things i wanted myself but i need help with one thing.

I want to replace the sprite graphic in the DMS with a face graphic that is in the pictures folder, but im kinda lost here, i found the draw_actor_graphic in window_base but got stuck there.

I tried to use DerVVulfman's script but it changed stuff that i didnt want changed ':|.

Anyone that can help out?
 
Code:
module RPG::Cache
  def self.face(filename, hue = 0)
    self.load_bitmap("Graphics/Faces/", filename, hue)
  end
end

class Window_Base
  def draw_actor_face(actor, x, y)
    bitmap = RPG::Cache.face(actor.character_name, actor.character_hue)
    self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
  end
end

Now create a new folder in your Graphics folder and name it Faces.
Put your face graphics in there and name them like the character set for your actor. Aluxes' face graphic for example would be 001-Fighter01.
Then in Window_MenuStatus in def refresh, change draw_actor_graphic with draw_actor_face.
 
That should work:
Code:
class Window_SaveFile 
  alias_method :raz_save_refresh, :refresh
  def initialize(file_index, filename)
    super(0, 64 + file_index % 4 * 104, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      Marshal.load(file)
      Marshal.load(file)
      Marshal.load(file)
      @game_party = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end

  def refresh
    raz_save_refresh
    if @file_exist
      self.contents.draw_text(x, y, 150, 32, "#{@game_party.actors[0].name}")
    end
  end
end

Just look for
self.contents.draw_text(x, y, 150, 32, "#{@game_party.actors[0].name}"
and change x and y to whatever you want.
 
This topic has been resolved. If Lazarus 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