RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Simple change menù

Started by Æliath, October 16, 2010, 12:45:14 PM

0 Members and 1 Guest are viewing this topic.

Æliath

Hello guys, I use this menu:
http://www.mundorpgmaker.com/forum/index.php?topic=20296.0
I wish I could insert a picture instead of the face, as in the example image:

I do i do?

cozziekuns

Here ya go.


module KPMH_Settings
 
  ACTOR_PICTURES ={
  # Actor ID => Filename
    1 => "Ralph",
    2 => "Ralph",
    3 => "Ralph",
    4 => "Ralph",
  }
 
  PICTURE_Y_OFFSET = 16 # Y-Offset of your picture
  CLASS_Y_OFFSET = 32 # Y-Offset of the class name text.
end
 
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a superclass of all windows in the game.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Image
  #     filename : filename
  #     face_index : Face graphic index
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     size       : Display size
  #--------------------------------------------------------------------------
  def draw_image(filename, x, y)
    bitmap = Cache.picture(filename)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = bitmap.width
    rect.height = bitmap.height
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
end

#==============================================================================
# Window_HMS
#------------------------------------------------------------------------------
# Janela que exibe os status dos membros da equipe no menu.
#==============================================================================

class Window_HMS < Window_Selectable
  #--------------------------------------------------------------------------
  # Atualização
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    create_contents
    # Define @fw (face width: largura da face) para organização
    for actor in $game_party.members
      # Exibição dos nomes dos personagens
      self.contents.font.color = system_color
      @cell_size
      self.contents.font.name = KPMH_Settings::MENU_FONT
      self.contents.draw_text(actor.index * @cell_size, 0, @cell_size, WLH,
      actor.name, 1)
      # Exibição dos arquivos de faces dos personagens
      if KPMH_Settings::STATUS_WINDOW_MODE == 0 ||
        KPMH_Settings::STATUS_WINDOW_MODE == 2
        draw_image(KPMH_Settings::ACTOR_PICTURES[actor.id], actor.index * (544 / 4), KPMH_Settings::PICTURE_Y_OFFSET)
      end
      # Exibição dos gráficos dos personagens
      if KPMH_Settings::STATUS_WINDOW_MODE == 1
        draw_character(actor.character_name, actor.character_index,
        actor.index * @cell_size + @cell_size / 2, WLH + 64)
      end
      if KPMH_Settings::STATUS_WINDOW_MODE == 2
        x = @column_max > 4 ? actor.index * @cell_size + 20 : actor.index *
        @cell_size + @cell_size / 2 - 34
        y = @column_max > 4 ? WLH + 5 + (96 - @cell_size) / 2 +
        @cell_size - 8 - 4 : WLH + 94
        draw_character(actor.character_name, actor.character_index, x, y)
      end
      # Exibição das classes dos personagens
      self.contents.font.color = normal_color
      self.contents.draw_text(actor.index * @cell_size, 96 + WLH + KPMH_Settings::CLASS_Y_OFFSET, @cell_size,
      WLH, actor.class.name, 1)
      # Exibição do estado físico dos personagens
      draw_actor_state(actor, actor.index * @cell_size, WLH * 2 + 96,
      @cell_size)
      # Exibição da nível dos personagens
      draw_actor_exp(actor, actor.index * @cell_size, WLH * 3 + 96,
      @cell_size - 8)
      # Exibição do HP dos personagens
      draw_actor_hp(actor, actor.index * @cell_size, WLH * 5 + 96,
      @cell_size - 8)
      # Exibição do MP dos personagens
      draw_actor_mp(actor, actor.index * @cell_size, WLH * 6 + 96,
      @cell_size - 8)
    end
  end
end


Enter this below your script. Tell me if there are any problems with it.

Æliath

I renamed the picture with the name 'Ralph', but I will not show.
There is always the face of the character ;_;

cozziekuns

Oh, I forgot to mention that you have to put the picture in your Graphics/Pictures folder.

Æliath

Yeah =)
I entered the picture in the Pictures folder, but does not work :P

cozziekuns

That's weird. Did you change the actor ID's to the actor ID of your actors?

Æliath

I called the Pictures 'Ralph', with ID1 and the character, too °_°
Something wrong?

cozziekuns

Change the name of the picture to Ralph without the quotation marks.

Æliath

It works perfectly, thanks!
I have a problem though.
You can enter the 'selectable', as big as the pictures? If the box is not as big as your face.

cozziekuns

Here you go.


module KPMH_Settings
 
  ACTOR_PICTURES ={
  # Actor ID => Filename
    1 => "Ralph",
    2 => "Ralph",
    3 => "Ralph",
    4 => "Ralph",
  }
 
  PICTURE_Y_OFFSET = 16
  CLASS_Y_OFFSET = 32
 
  CURSOR_WIDTH = 136
  CURSOR_HEIGHT = 130
end
 
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a superclass of all windows in the game.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Image
  #     filename : filename
  #     face_index : Face graphic index
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     size       : Display size
  #--------------------------------------------------------------------------
  def draw_image(filename, x, y)
    bitmap = Cache.picture(filename)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = bitmap.width
    rect.height = bitmap.height
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
end

#==============================================================================
# Window_HMS
#------------------------------------------------------------------------------
# Janela que exibe os status dos membros da equipe no menu.
#==============================================================================

class Window_HMS < Window_Selectable
  #--------------------------------------------------------------------------
  # Atualização
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    create_contents
    # Define @fw (face width: largura da face) para organização
    for actor in $game_party.members
      # Exibição dos nomes dos personagens
      self.contents.font.color = system_color
      @cell_size
      self.contents.font.name = KPMH_Settings::MENU_FONT
      self.contents.draw_text(actor.index * @cell_size, 0, @cell_size, WLH,
      actor.name, 1)
      # Exibição dos arquivos de faces dos personagens
      if KPMH_Settings::STATUS_WINDOW_MODE == 0 ||
        KPMH_Settings::STATUS_WINDOW_MODE == 2
        draw_image(KPMH_Settings::ACTOR_PICTURES[actor.id], actor.index * (544 / 4), KPMH_Settings::PICTURE_Y_OFFSET)
      end
      # Exibição dos gráficos dos personagens
      if KPMH_Settings::STATUS_WINDOW_MODE == 1
        draw_character(actor.character_name, actor.character_index,
        actor.index * @cell_size + @cell_size / 2, WLH + 64)
      end
      if KPMH_Settings::STATUS_WINDOW_MODE == 2
        x = @column_max > 4 ? actor.index * @cell_size + 20 : actor.index *
        @cell_size + @cell_size / 2 - 34
        y = @column_max > 4 ? WLH + 5 + (96 - @cell_size) / 2 +
        @cell_size - 8 - 4 : WLH + 94
        draw_character(actor.character_name, actor.character_index, x, y)
      end
      # Exibição das classes dos personagens
      self.contents.font.color = normal_color
      self.contents.draw_text(actor.index * @cell_size, 96 + WLH + KPMH_Settings::CLASS_Y_OFFSET, @cell_size,
      WLH, actor.class.name, 1)
      # Exibição do estado físico dos personagens
      draw_actor_state(actor, actor.index * @cell_size, WLH * 2 + 96,
      @cell_size)
      # Exibição da nível dos personagens
      draw_actor_exp(actor, actor.index * @cell_size, WLH * 3 + 96,
      @cell_size - 8)
      # Exibição do HP dos personagens
      draw_actor_hp(actor, actor.index * @cell_size, WLH * 5 + 96,
      @cell_size - 8)
      # Exibição do MP dos personagens
      draw_actor_mp(actor, actor.index * @cell_size, WLH * 6 + 96,
      @cell_size - 8)
    end
  end
  #--------------------------------------------------------------------------
  # Atualização do cursor
  #--------------------------------------------------------------------------
  def update_cursor
    index = @index - @index_increment
    if !self.active            # Sem cursor
      self.cursor_rect.empty
    elsif index < @item_max    # Padrão
      self.cursor_rect.set(index * @cell_size, WLH, KPMH_Settings::CURSOR_WIDTH, KPMH_Settings::CURSOR_HEIGHT)
    elsif index >= 100         # Si
      self.cursor_rect.set((index - 100) * @cell_size, WLH, KPMH_Settings::CURSOR_WIDTH, KPMH_Settings::CURSOR_HEIGHT)
    else                       # O todo
      self.cursor_rect.set(0, WLH, @item_max * KPMH_Settings::CURSOR_WIDTH, KPMH_Settings::CURSOR_HEIGHT)
    end
  end
end

Æliath

Thanks Ness, but you can not do that flashes the pictures?
Also, I just got an idea °_°
I use this script to animate monsters (breathing effect):
# ?S?}?X?^?[?X?N???v?g????X?N???v?g
#  ?T?|?[?g?f???? http://www2.ezbbs.net/21/minto-aaa/
#   by ????
# RPG Maker VX
# ver 1.02
# ?RGSS?p??d?l???X?B
# ver 1.01
#==============================================================================
# ?? MINTO
#------------------------------------------------------------------------------
#   ?l?X??t???O??????C?????W???[??????B
#==============================================================================
#module MINTO
  # breathing crypt enabling (with true validity/with false invalidity) RGSS
# RGSS["breathing"] = true
#end
#==============================================================================
# ?? ?J?X?^?}?C?Y
#------------------------------------------------------------------------------
#   ?@?\??J?X?^?}?C?Y??s??????B
#==============================================================================

module MINTO_Sprite_Battler_01
  #--------------------------------------------------------------------------
  # ?? ?G?l?~?[??O????????????t???O???
  #--------------------------------------------------------------------------
  def breathe?
    # true with permission/false non- permission
    return false #laesst heros atmen wenn an.. aber sieht nicht aus
  end
end
 
#if MINTO::RGSS["breathing"] == true then

#==============================================================================
# ?? MINTO_Sprite_Battler_01
#------------------------------------------------------------------------------
#   Sprite_Battler?N???X??????V?X?e?????W???[??????B
#==============================================================================

module MINTO_Sprite_Battler_01
  #--------------------------------------------------------------------------
  # Object initialization
  #    viewport : View port
  #--------------------------------------------------------------------------
  def initialize(viewport)
    # data for breathing setting
    @zoom_turn = 0.075  #0.075  fand 0.02 ganz gut
    @zoom_count = 0 #0
    @zoom_puls = 100 #100
    @zoom_count = rand(23) #23 normal
    # superclass execution
    super(viewport)
  end
  #--------------------------------------------------------------------------
  # Frame renewal (breathing)
  #--------------------------------------------------------------------------
  def update_standby
    # ?o?g???[????????
    if @battler == nil then
      # ???\?b?h????
      return
    end
    # ?o?g???[???G?l?~?[??O???
    if @battler.class != Game_Enemy then
      # ??????????????????????
      if breathe? == false then
        # ???\?b?h????
        return
      end
    end
    # method addition
    @zoom_count += 1
    # counts become 24 ???????
    if @zoom_count == 24 then   #24   fand hier 64 okay
      # counts initialization
      @zoom_count = 0
      # breathing turns the reversal
      @zoom_turn *= -1
    end
    # breathing setting
    @zoom_puls -= @zoom_turn
    # ?c??Y?[????X?V????
    self.zoom_y = (1.0 * @zoom_puls) / 100
  end
  #--------------------------------------------------------------------------
  # ?? ?t???[???X?V
  #--------------------------------------------------------------------------
  def update
    # ?R???v?X??s????????
    if @effect_type != Sprite_Battler::COLLAPSE then
      # ?A?j????s????????
      if @animation_duration == 0 then
        # ????????X?V
        update_standby
      end
    end
    # ?X?[?p?[?N???X???s
    super
  end
end
#==============================================================================
# ?? Sprite_Battler
#------------------------------------------------------------------------------
# ?@?o?g???[?\???p??X?v???C?g????BGame_Battler ?N???X??C???X?^???X???????A
# ?X?v???C?g???????I????????????B
#==============================================================================

class Sprite_Battler < Sprite_Base
  #--------------------------------------------------------------------------
  # ?? ?V?X?e???C???N???[?h??
  #--------------------------------------------------------------------------
  include MINTO_Sprite_Battler_01         # ????X?v???C?g?o?g???[
end

#end

If we put the battler in the menu instead of the pictures, we can animate the battler in the menu :Q_____
It can be done?
It would be the best, and thank you for the support you're giving me =)

Æliath