Voir le nom du lieu sur la carte

Créer un nouveau script au dessus de main. Appeler le Window_Map_Name et insérez le script suivant

#==============================================================================
# ¡ Window_Map_Name
#------------------------------------------------------------------------------
class Window_Map_Name < Window_Base
  attr_accessor :text

  #--------------------------------------------------------------------------
  # œ ƒIƒuƒWƒFƒNƒg‰Šú
  #--------------------------------------------------------------------------
  def initialize
     super(8, -8, 640, 64)
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    self.contents.font.name = "Arial"
    @align = 1
    @showing_time = -1
    @text_color   = Color.new(255, 255, 0, 255)
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def set_text(text, align = 2)
    if text != @text or align != @align
      @text = text
      @align = align
      if text.empty? or text =~ /^\./
        @showing_time = -1
        self.contents_opacity = 0
        self.visible = false
      else
        @showing_time = 100
        self.contents_opacity = 255
        self.visible = true
        self.contents.clear
        x = 4
        y = 0
        width = self.contents.width - 8
        str = "- "+@text+" -"
        self.contents.font.color = Color.new(  0,  0,  0, 192)
        self.contents.draw_text(x+2, y+2, width, 32, str, @align)
        self.contents.font.color = Color.new( 64, 64, 64, 192)
        self.contents.draw_text(x-1, y-1, width, 32, str, @align)
        self.contents.draw_text(x+1, y-1, width, 32, str, @align)
        self.contents.draw_text(x-1, y+1, width, 32, str, @align)
        self.contents.draw_text(x+1, y+1, width, 32, str, @align)
        self.contents.font.color = @text_color
        self.contents.draw_text(x,   y,   width, 32, str, @align)
      end
    end
  end
  #--------------------------------------------------------------------------
  # œ Ä•`‰æ
  #--------------------------------------------------------------------------
  def update
    return if @showing_time < 0
    @showing_time -= 1
    if @showing_time < 16
      self.contents_opacity = @showing_time * 16
      if @showing_time == 0
        self.visible = false
        self.contents.clear
        return
      end
    end
  end
end
#==============================================================================
# ¡ Scene_Map
#==============================================================================
class Scene_Map
  def initialize_map_name_window(text = nil)
    if @map_name_window.nil?
      @map_name_window = Window_Map_Name.new
      @map_name_window.opacity = 0
      @map_name_window.text = text if not text.nil?
    end
  end
  #--------------------------------------------------------------------------
  # œ ƒƒCƒ“ˆ—
  #--------------------------------------------------------------------------
  alias xrxs20_main main
  def main
    initialize_map_name_window
    xrxs20_main
    @map_name_window.dispose
  end
  #--------------------------------------------------------------------------
  # œ ƒtƒŒ[ƒ€XV
  #--------------------------------------------------------------------------
  alias xrxs20_update update
  def update
    @map_name_window.set_text($game_map.name)
    @map_name_window.update
    xrxs20_update
  end
end
#==============================================================================
# ¡ Scene_Title
#==============================================================================
class Scene_Title
  alias xrxs20_main main
  def main
    $map_infos = load_data("Data/MapInfos.rxdata")
    for key in $map_infos.keys
      $map_infos[key] = $map_infos[key].name
    end
    xrxs20_main
  end
end
#==============================================================================
# ¡ Game_Map
#==============================================================================
class Game_Map
  def name
    $map_infos[@map_id]
  end
end
#==============================================================================
# ¡ Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # œ ƒƒCƒ“ˆ—
  #--------------------------------------------------------------------------
  alias xrxs20_main main
  def main
    xrxs20_main
    if $scene.is_a?(Scene_Map) and (not XRXS20_Config::SCENE_BATTLE_TO_SCENE_MAP)
      $scene.initialize_map_name_window($game_map.name)
    end
  end
end

Auteur: Danny Coulombe
Créé le: 2007-12-15 23:59:51
Cette page a été vues: 6555 fois

Prenez le temps de visiter nos partenaires

Au programme actu, sorties, photos, cosplays, objets dérivés, liens sympa,vidéos... Tout sur Kingdom Hearts, des actus, des soluces, des vidéos, des musiques et plus encore... Forum réservé pour makers, traitant de thème divers. iKara Rpg Maker Le site de tous les romans de jeux vidéos Premier site de gestion de recrutement et d'équipe pour rpgmaker ! Site officiel du studio Galfart. Jeux et projets Galfart y sont présentés, ainsi que des ressources, scripts, tutoriaux, logiciels sont disponibles. Site consacré à Indie Game Maker, tutoriels, forum, 1 license d'IGM à gagner

Création de Danny Coulombe [ Administration ]
Revu et recodé par Guillaume DIOT

Ajouter aux favoris Ajouter à mes favoris
Abonnement à au bulletin d'informations Newsletters
Abonnement aux flux d'actualités RSS M'abonner aux flux RSS

Espace membres

Pas encore membre ? Inscrivez-vous
Pass oublié ? Cliquez ici

RMoogle



Actuellement en ligne

Votez pour nous


rpg maker online com
votez