Total rpg maker XP
Administrateurs : gregory
 
 Total rpg maker XP  Rpg maker XP  Scripts 

 Lieu dit sur la map

Nouveau sujet   Répondre
 
Bas de pagePages : 1  
gregory
Membres
39 messages postés
   Posté le 12-07-2006 à 13:41:11   Voir le profil de gregory (Offline)   Répondre à ce message   Envoyer un message privé à gregory   

De base, il s'affiche en haut à droite et ce script prend en fait le nom que vous avez donné à la map pour l'afficher.

Ouvrez l'éditeur de script et créez en un nouveau au dessus de 'Main' qui portera le nom de 'XRXS20' et collez le code ci-dessous:

Code
module XRXS20_Config
SCENE_BATTLE_TO_SCENE_MAP = true
end

#==============================================================================
# Window_Map_Name
#==============================================================================
class Window_Map_Name < Window_Base

def initialize
super(8, -8, 640, 64)
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.contents.font.name = "Tahoma"
@align = 1
@showing_time = 0
@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 -= 0
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
#==============================================================================
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
#--------------------------------------------------------------------------
alias xrxs20_main main
def main
initialize_map_name_window
xrxs20_main
@map_name_window.dispose
end
#--------------------------------------------------------------------------
alias xrxs20_update update
def update
@map_name_window.set_text($game_map.name)
@map_name_window.update
xrxs20_update
end
end

#==============================================================================
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
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
def name
$map_infos[@map_id]
end
end
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
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

gregory
Membres
39 messages postés
   Posté le 12-07-2006 à 13:42:12   Voir le profil de gregory (Offline)   Répondre à ce message   Envoyer un message privé à gregory   


Haut de pagePages : 1  
 
 Total rpg maker XP  Rpg maker XP  Scripts  Lieu dit sur la mapNouveau sujet   Répondre
 
Identification rapide :         
 
Divers
Imprimer ce sujet
Aller à :   
 
créer forum