Forum des makers de 78
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Forum des makers de 78

Un forum sur rpg maker
 
AccueilPortailRechercherDernières imagesS'enregistrerConnexion
-17%
Le deal à ne pas rater :
Casque de réalité virtuelle Meta Quest 2 128 Go Blanc (+29,99€ ...
249.99 € 299.99 €
Voir le deal

 

 Afficher le nom de la map

Aller en bas 
2 participants
AuteurMessage
Argentis
Admin
Admin
Argentis


Nombre de messages : 121
Age : 30
Localisation : Je t'en pose des questions moi?
Votre domaine making? : Mapper et scénariste
Date d'inscription : 16/04/2007

Feuille de making
Statut:
Point d'aide:
Afficher le nom de la map Left_bar_bleue17/100Afficher le nom de la map Empty_bar_bleue  (17/100)

Afficher le nom de la map Empty
MessageSujet: Afficher le nom de la map   Afficher le nom de la map Icon_minitimeSam 26 Mai - 15:59

Ce script sert à faire afficher pendant quelques instant le nom de la map en haut de la carte.


Code:
#==============================================================================
# �¡ 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ƒŒ�[ƒ€�X�V
#--------------------------------------------------------------------------
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
Revenir en haut Aller en bas
https://maker78.forumactif.fr
Osiris
Nouveau
Nouveau



Nombre de messages : 4
Votre domaine making? : aucun en particulier
Date d'inscription : 05/06/2007

Afficher le nom de la map Empty
MessageSujet: Re: Afficher le nom de la map   Afficher le nom de la map Icon_minitimeMer 6 Juin - 16:46

ce script est bien mais ne s'accorde pas avec les autres script comme par exemple train actor (equipe en chenille)
Revenir en haut Aller en bas
 
Afficher le nom de la map
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Forum des makers de 78 :: Divers :: Méli-Mélo-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser