The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Zulen on September 04, 2006, 07:05:56 AM

Title: Image in Menu instead of Character Sprite (Help)
Post by: Zulen on September 04, 2006, 07:05:56 AM
A good while ago, a friend of mine had a script for his game. It was just like Dubleax/Slipknot's Advanced Messege System, only he somehow got images into the menu screen, in place of his character sprites.

I'd rather have an image of the person there, instead of a character sprite.

He doesn't remember how he did it, my friend, but he said to check on Crankeye.

So...is it a special script I need to get images into the menu, or is it a command that comes with Dubleax/Slipknot's AMS?

Title: Re: Image in Menu instead of Character Sprite (Help)
Post by: Tsunokiette on September 04, 2006, 04:38:11 PM
Quote from: Zulen on September 04, 2006, 07:05:56 AM
A good while ago, a friend of mine had a script for his game. It was just like Dubleax/Slipknot's Advanced Messege System, only he somehow got images into the menu screen, in place of his character sprites.

I'd rather have an image of the person there, instead of a character sprite.

He doesn't remember how he did it, my friend, but he said to check on Crankeye.

So...is it a special script I need to get images into the menu, or is it a command that comes with Dubleax/Slipknot's AMS?



This is how you add faces, edit this to your liking.

First you create a method to load the bitmap in RPG::Cache -

module RPG
      module Cache
            def faces(filename)
                  path = "Graphics/Faces/"
                  return load_bitmap(path,filename)
            end
      end
end


Now go into Window_Base and add this -

      def draw_actor_face(actor,x,y)
            bitmap = RPG::Cache.faces(actor.name)
            rect = Rect.new(x, y, bitmap.width, bitmap.height)
            self.contents.blt(rect,bitmap)
      end


Then in the window you want to draw a face just type -

draw_actor_face(actor, x, y)

In the refresh method with all of the other drawing methods.

Actor should already be defined so you can leave it as is, and the x and y are the coordinates you want the face to be.

This may or may not work, this is from the top of my head.

EDIT: I forgot to mention that you need to create a Faces folder in the Graphics folder and place all your faces there, making the filenames the same as the character's name.