RPG Fusion
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.



 
AccueilPortailRechercherDernières imagesS'enregistrerConnexion
-23%
Le deal à ne pas rater :
EVGA SuperNOVA 650 G6 – Alimentation PC 100% modulaire 650W, 80+ ...
77.91 € 100.91 €
Voir le deal

 

 Nom au dessus du personnage

Aller en bas 
AuteurMessage
Mikashi
Jongleur Itinérant
Jongleur Itinérant
Mikashi


Masculin
Nombre de messages : 79
Age : 30
Projet(s) en cours : La Main De Dieu
Niveau Rpg Maker : Ca passe quoi, je sais tous ce qu'il y a a savoir, sauf le ruby .
Jeux Préférés : Tales Of Symphonia, Final Fantasy , Ragnarok , Naruto 4 ...
Date d'inscription : 15/07/2007

Nom au dessus du personnage Empty
MessageSujet: Nom au dessus du personnage   Nom au dessus du personnage EmptyJeu 19 Juil 2007, 10:31

Bonjour Bonsoir a toutes et a tous ! Voici un script permettant de mettre le nom du personnage au dessus de sa tete . Voici tous ce qui a a savoir :

Screen :Nom au dessus du personnage Screen_nomt

Comment l'utiliser :

Faites un évènement et mettez y un commentaire comportant ceci :

[CDnom]. Remplacez "nom" par le nom de l'évènement.

Exemple : [CDLink]

Pour changer le nom du héros, allez à la ligne 103 du script :

when 'Name'
txt = "Héros"

Remplacez "Héros" par le nom du héros souhaité.




Script : Au dessus de Main


Code:
#==============================================================================
# ** Event Text Display
#==============================================================================
# Created By: Ãص¹
# Modified By: SephirothSpawn
# Modified By: Meâ„¢
# Version 2.1
# 2006-03-04
#==============================================================================
# * Instructions :
#
# ~ Creating Event With Text Display
# - Put a Comment on the Page With
# [CD____]
# - Place Text to Be Displayed in the Blank
#------------------------------------------------------------------------------
# * Customization :
#
# ~ NPC Event Colors
# - Event_Color = Color
#
# ~ Player Event Color
# - Player_Color = Color
#
# ~ Player Text
# - Player_Text = text_display *
#
# ~ text_display
# - 'Name', 'Class', 'Level', 'Hp', 'Sp'
#==============================================================================

#==============================================================================
# ** Game_Character
#==============================================================================

class Game_Character
#--------------------------------------------------------------------------
# * Dispaly Text Color (Event & Player)
#--------------------------------------------------------------------------
Event_Color = Color.new(0, 0, 200)
Player_Color = Color.new(200, 0, 0)
#--------------------------------------------------------------------------
# * Display Choices
# ~ 'Name', 'Class', 'Level', 'Hp', 'Sp'
#--------------------------------------------------------------------------
Player_Text = 'Name'
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :text_display
end

#==============================================================================
# ** Game_Event
#==============================================================================

class Game_Event < Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_characterdisplay_gevent_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Original Refresh Method
seph_characterdisplay_gevent_refresh
# Checks to see if display text
# If the name contains CD, it takes the rest of the name as the text
unless @list.nil?
for i in 0...@list.size
if @list[i].code == 108
@list[i].parameters[0].dup.gsub!(/[[Cc][Dd](.+?)]/) do
@text_display = [$1, Event_Color]
end
end
end
end
@text_display = nil if @erased
end
end

#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_characterdisplay_gplayer_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Original Refresh Method
seph_characterdisplay_gplayer_refresh
# Gets First Actor
actor = $game_party.actors[0]
# Determines Text
case Player_Text
when 'Name'
txt = "Héros"
when 'Class'
txt = actor.class_name
when 'Level'
txt = "Level: #{actor.level}"
when 'Hp'
txt = "HP: #{actor.hp} / #{actor.maxhp}"
when 'Sp'
txt = "SP: #{actor.sp} / #{actor.maxsp}"
else
txt = ''
end
# Creates Text Display
@text_display = [txt, Player_Color]
end
end

#==============================================================================
# ** Sprite_Character
#==============================================================================

class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_characterdisplay_scharacter_update update
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original update Method
seph_characterdisplay_scharacter_update
# Character Display Update Method
update_display_text
end
#--------------------------------------------------------------------------
# * Create Display Sprite
#--------------------------------------------------------------------------
def create_display_sprite(args)
Font.default_size = 12
Font.default_name = "Verdana"
# Creates Display Bitmap
bitmap = Bitmap.new(160, 24)
# Draws Text Shadow
# if bitmap.font.respond_to?(:draw_shadow)
# bitmap.font.draw_shadow = false
# end
# bitmap.font.color = Color.new(0, 0, 0)
# bitmap.draw_text(1, 1, 160, 24, args[0], 1)
# Changes Font Color
bitmap.font.color = args[1]
# Draws Text
bitmap.draw_text(0, 0, 160, 24, args[0], 1)
# Creates Display Text Sprite
@_text_display = Sprite.new(self.viewport)
@_text_display.bitmap = bitmap
@_text_display.ox = 80
@_text_display.oy = 24
@_text_display.x = self.x
@_text_display.y = self.y - self.oy / 2 - 24
@_text_display.z = 30001
@_text_display.visible = self.visible #true
end
#--------------------------------------------------------------------------
# * Dispose Display Sprite
#--------------------------------------------------------------------------
def dispose_display_text
unless @_text_display.nil?
@_text_display.dispose
end
#reset font colors
Font.default_size = 14
Font.default_name = "Verdana"
end
#--------------------------------------------------------------------------
# * Update Display Sprite
#--------------------------------------------------------------------------
def update_display_text
unless @character.text_display.nil?
if @_text_display.nil?
create_display_sprite(@character.text_display)
end
@_text_display.x = self.x
@_text_display.y = self.y - self.oy / 2 - 24
lastx = $game_temp.player_new_x
lasty = $game_temp.player_new_y
# if self.x > lastx and self.y > lasty
# @_text_display.opacity = 255 - (self.x - lastx) - (self.y - lasty)
# elsif self.x < lastx and self.y > lasty
# @_text_display.opacity = 255 - (lastx - self.x) - (self.y - lasty)
# elsif self.x > lastx and self.y < lasty
# @_text_display.opacity = 255 - (self.x - lastx) - (lasty - self.y)
# else
# @_text_display.opacity = 255 - (lastx - self.x) - (lasty - self.y)
# end
else
unless @_text_display.nil?
dispose_display_text
end
end
#reset font colors
Font.default_size = 14
Font.default_name = "Verdana"
end
end


Dernière édition par le Ven 20 Juil 2007, 17:25, édité 1 fois
Revenir en haut Aller en bas
http://la-main-de-dieu.darkbb.fr
 
Nom au dessus du personnage
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» L' avatar du dessus
» Crache-moi dessus... peu me chaut.
» Sauter au dessus de terrains
» superposer des animations /events par dessus une image
» Choix de personnage

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Fusion :: BANQUE DU CODE :: Antre des Scripts :: Map-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser