MOG Scene Name Iris V1.3

7 de agosto de 2014

MOG Scene Name Iris é um script de Scene Name com movimentos e layout em pictures, desenvolvido pelo Moghunter, para ser usado no RPG Maker XP.

O script é de simples instalação e só precisa de inseri-lo, junto com umas pictures na pasta do projeto.

Screenshot

MOG Scene Name Iris

Instalação

Adicione o script acima do Main. Dê uma olhada na demo para ver direitinho como que faz e pegar as imagens que precisa, etc.

#_______________________________________________________________________________
# MOG_Scene_Name V1.3           
#_______________________________________________________________________________
# By Moghunter     
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Scene Name com layout e movimento.
# (Crie seu próprio estilo.)
#_______________________________________________________________________________
module MOG
  # Tempo de transição.
  MSNTT1 = 30
  # Definição do tipo de transição.
  MSNTT2 = "004-Blind04"
end

#===============================================================================
# Window_Base
#===============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# draw_battler
#--------------------------------------------------------------------------  
  def draw_battler(actor,x,y)
    battler = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    cw = battler.width 
    ch = battler.height 
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y - ch, battler, src_rect)    
  end 
#--------------------------------------------------------------------------
# draw_actor_level_name
#--------------------------------------------------------------------------  
  def draw_actor_level_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x , y, 24, 32, actor.level.to_s, 1)
  end
#--------------------------------------------------------------------------
# draw_actor_class
#--------------------------------------------------------------------------  
  def draw_actor_class_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 120, 32, actor.class_name,1)
  end
#--------------------------------------------------------------------------
# draw_actr_name
#--------------------------------------------------------------------------  
  def draw_actr_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 120, 32, actor.name,1)
  end
end

#===============================================================================
# Window_Status_Name
#===============================================================================
class Window_Status_Name < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------    
  def initialize(actor)
    super(0, 0, 320, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Georgia"
    @actor = actor
    self.opacity = 0
    refresh
  end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------  
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 50, 110)
    draw_actor_class_name(@actor, 55, 395)
    draw_actor_level_name(@actor, 20, 120)
    draw_battler(@actor, 20, 350)
  end
end

#===============================================================================
# Window_NameEdit2
#===============================================================================
class Window_NameEdit2 < Window_Base
  attr_reader   :name                   
  attr_reader   :index           
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------  
  def initialize(actor, max_char)
    super(0, 25, 640, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    @name = actor.name
    @max_char = max_char
    name_array = @name.split(//)[0...@max_char]
    @name = ""
    for i in 0...name_array.size
      @name += name_array[i]
    end
    @default_name = @name
    @index = name_array.size
    refresh
    update_cursor_rect
  end
#--------------------------------------------------------------------------
# restore_default
#--------------------------------------------------------------------------  
  def restore_default
    @name = @default_name
    @index = @name.split(//).size
    refresh
    update_cursor_rect
  end
#--------------------------------------------------------------------------
# add
#--------------------------------------------------------------------------  
  def add(character)
    if @index < @max_char and character != ""
      @name += character
      @index += 1
      refresh
      update_cursor_rect
    end
  end
#--------------------------------------------------------------------------
# back
#--------------------------------------------------------------------------  
  def back
    if @index > 0
      name_array = @name.split(//)
      @name = ""
      for i in 0...name_array.size-1
        @name += name_array[i]
      end
      @index -= 1
      refresh
      update_cursor_rect
    end
  end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------  
  def refresh
    self.contents.clear
    name_array = @name.split(//)
    for i in 0...@max_char
      c = name_array[i]
      if c == nil
        c = "_"
      end
      x = 320 - @max_char * 14 + i * 28
      self.contents.draw_text(x + 32, 64, 28, 32, c, 1)
    end
    draw_actr_name(@actor, 295, 20)
  end
#--------------------------------------------------------------------------
# update_cursor_rect
#--------------------------------------------------------------------------  
  def update_cursor_rect
    x = 320 - @max_char * 14 + @index * 28
    self.cursor_rect.set(x + 32, 64, 28, 32)
  end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------  
  def update
    super
    update_cursor_rect
  end
end

#===============================================================================
# Window_NameInput2
#===============================================================================
class Window_NameInput2 < Window_Base
CHARACTER_TABLE =
[
"A","B","C","D","E",
"F","G","H","I","J",
"K","L","M","N","O",
"P","Q","R","S","T",
"U","V","W","X","Y",
"Z",""," "," "," ",
"+","-","*","/","!",
"1","2","3","4","5",
"" ,"" ,"" ,"" ,"" ,
"a","b","c","d","e",
"f","g","h","i","j",
"k","l","m","n","o",
"p","q","r","s","t",
"u","v","w","x","y",
"z"," "," "," "," ",
"#","$","%","&","@",
"6","7","8","9","0",
"" ,"" ,"" ,"" ,"" ,
]

#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------  
  def initialize
    super(64, 140, 640, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    @index = 0
    refresh
    update_cursor_rect
  end
  
#--------------------------------------------------------------------------
# character
#--------------------------------------------------------------------------  
  def character
    return CHARACTER_TABLE[@index]
  end

#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------  
  def refresh
    self.contents.clear
    for i in 0...90
    x = 140 + i / 5 / 9 * 180 + i % 5 * 32
    y = i / 5 % 9 * 32
    self.contents.draw_text(x, y, 32, 32, CHARACTER_TABLE[i], 1)
    end
    self.contents.draw_text(428, 9 * 32, 48, 32, "OK", 1)
  end
#--------------------------------------------------------------------------
# update_cursor_rect
#--------------------------------------------------------------------------  
  def update_cursor_rect
    if @index >= 90
      self.cursor_rect.set(428, 9 * 32, 48, 32)
    else
      x = 140 + @index / 5 / 9 * 180 + @index % 5 * 32
      y = @index / 5 % 9 * 32
      self.cursor_rect.set(x, y, 32, 32)
    end
  end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------  
def update
super
  if @index >= 90
      if Input.trigger?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        @index -= 90
      end
      if Input.repeat?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        @index -= 90 - 40
      end
    else
    if Input.repeat?(Input::RIGHT)
      if Input.trigger?(Input::RIGHT) or
        @index / 45 < 3 or @index % 5 < 4
        $game_system.se_play($data_system.cursor_se)
        if @index % 5 < 4
          @index += 1
        else
          @index += 45 - 4
        end
        if @index >= 90
          @index -= 90
        end
      end
    end
    if Input.repeat?(Input::LEFT)
      if Input.trigger?(Input::LEFT) or
        @index / 45 > 0 or @index % 5 > 0
        $game_system.se_play($data_system.cursor_se)
      if @index % 5 > 0
        @index -= 1
      else
        @index -= 45 - 4
      end
      if @index < 0
        @index += 90
      end
    end
  end
  if Input.repeat?(Input::DOWN)
    $game_system.se_play($data_system.cursor_se)
    if @index % 45 < 40
      @index += 5
    else
      @index += 90 - 40
    end
  end
  if Input.repeat?(Input::UP)
    if Input.trigger?(Input::UP) or @index % 45 >= 5
      $game_system.se_play($data_system.cursor_se)
      if @index % 45 >= 5
        @index -= 5
      else
        @index += 90
      end
    end
  end
  if Input.repeat?(Input::L) or Input.repeat?(Input::R)
    $game_system.se_play($data_system.cursor_se)
    if @index < 45
      @index += 45
    else
      @index -= 45
    end
    end
  end
  update_cursor_rect
 end
end

#===============================================================================
# Scene_Name
#===============================================================================
class Scene_Name
#--------------------------------------------------------------------------
# Main
#--------------------------------------------------------------------------    
  def main
    @actor = $game_actors[$game_temp.name_actor_id]
    @edit_window = Window_NameEdit2.new(@actor, $game_temp.name_max_char)
    @edit_window.opacity = 0
    @input_window = Window_NameInput2.new
    @input_window.opacity = 0
    @name_back = Plane.new
    @name_back.bitmap = RPG::Cache.picture("MN_BK")
    @name_back.z = 10
    @name_back.opacity = 255
    @name_lay = Plane.new
    @name_lay.bitmap = RPG::Cache.picture("Name_Lay")
    @name_lay.z = 15
    @name_lay.opacity = 255
    @name_status_window = Window_Status_Name.new(@actor)
    @name_status_window.x -= 300
    @name_status_window.contents_opacity = 0
    Graphics.transition(MOG::MSNTT1, "Graphics/Transitions/" + MOG::MSNTT2)
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @edit_window.dispose
    @input_window.dispose
    @name_back.dispose
    @name_lay.dispose
    @name_status_window.dispose
  end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------    
  def update
    @name_back.ox += 1 
    if @name_status_window.x < 0
      @name_status_window.x += 15
      @name_status_window.contents_opacity += 5
    elsif @name_status_window.x >= 0
      @name_status_window.x = 0
      @name_status_window.contents_opacity = 255
    end
    @edit_window.update
    @input_window.update
    if Input.repeat?(Input::B)
      if @edit_window.index == 0
        return
      end
      $game_system.se_play($data_system.cancel_se)
      @edit_window.back
      return
    end
    if Input.trigger?(Input::C)
      if @input_window.character == nil
        if @edit_window.name == ""
          @edit_window.restore_default
          if @edit_window.name == ""
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          $game_system.se_play($data_system.decision_se)
          return
        end
        @actor.name = @edit_window.name
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Map.new
        return
      end
      if @edit_window.index == $game_temp.name_max_char
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if @input_window.character == ""
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @edit_window.add(@input_window.character)
      return
    end
  end
end


$mog_rgss_Scene_Name = true
autor, site, canal ou publisher Moghunter tamanho 224KB licençaGrátis sistemas operacionais compativeisWindows 98/98SE/Me/2000/XP/Vista/7 download link DOWNLOAD

Observação: se você gostou deste post ou ele lhe foi útil de alguma forma, por favor considere apoiar financeiramente a Gaming Room. Fico feliz só de ajudar, mas a contribuição do visitante é muito importante para que este site continua existindo e para que eu possa continuar provendo este tipo de conteúdo e melhorar cada vez mais. Clique aqui e saiba como. Obrigado!

Deixe um comentário

Inscreva-se na nossa newsletter!