Naqqah Administrateur
Nombre de messages : 844 Age : 28 Localisation : Parti manger un ours Date d'inscription : 22/02/2009
| Sujet: [VX]Bulle expressives sur faces Sam 13 Fév - 12:59 | |
| Auteur : Nechigawara Sanzenin Fonction : Permet de mettre une expression sur le visage (Faces). Les images sont déjà dans le dossier "System" de votre jeu. Image(s) : Installation : Ouvrez l'éditeur de script ( F11 ). Créez en un nouveau au dessus de "Main" et collez le code ci-dessous. Utilisation : Mettez au début de votre message : \E[x] où "x" est le numéro de l'expression. Exemple : \E[1] affichera un point d'exclamation (image ci-dessus) Code : - Code:
-
#==============================================================================
# Emoticon on Face
#------------------------------------------------------------------------------
# By Nechigawara Sanzenin
# WARNING!! : This script can use on RPG Maker VX Only!! (XP Not Support)
=begin
How to Use:
Add "\E[Number Of Emoticon]" To text in message control
You can see Number of Emoticon on "Balloon.png" in "Graphics\System" or
"%programfiles%\Common Files\Enterbrain\RGSS2\RPGVX\Graphics\System".
when the line number of emoticonset is 1 , Number of Emoticon is 1.
when the line number of emoticonset is 2 , Number of Emoticon is 2.
Max of Number of Emoticon is 10.
You can set Emoticon's Position at EMO_X and EMO_y.
You can set frame rate at BALLOON_WAIT.
if the message window don't have face,Noting happen.
=end
#==============================================================================
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
BALLOON_WAIT = 12
EMO_X = 93
EMO_Y = 15
#--------------------------------------------------------------------------
alias inc_initialize initialize
def initialize
inc_initialize
@viewport = Viewport.new(0, 0, 544, 416)
@viewport.z = z + 50
@balloon_face = 0
create_balloon
end
#--------------------------------------------------------------------------
alias inc_dispose dispose
def dispose
inc_dispose
dispose_balloon
@viewport.dispose
end
#--------------------------------------------------------------------------
def update
super
update_gold_window
update_number_input_window
update_back_sprite
update_show_fast
update_balloon
unless @opening or @closing # ???????????
if @wait_count > 0 # ????????
@wait_count -= 1
elsif self.pause # ???????
input_pause
elsif self.active # ??????
input_choice
elsif @number_input_window.visible # ?????
input_number
elsif @text != nil # ????????
update_message # ????????
elsif continue? # ?????
start_message # ????????
open # ????????
$game_message.visible = true
else # ??????
close # ?????????
$game_message.visible = @closing
end
end
end
#--------------------------------------------------------------------------
def create_balloon
dispose_balloon
@balloon_duration = 8 * 8 + BALLOON_WAIT
@balloon_sprite = ::Sprite.new(@viewport)
@balloon_sprite.bitmap = Cache.system("Balloon")
@balloon_sprite.ox = 16
@balloon_sprite.oy = 32
@balloon_sprite.visible = false
update_balloon
end
#--------------------------------------------------------------------------
def refresh_balloon
if @balloon_face == 0 or @balloon_face > 10
@balloon_sprite.visible = false
else
@balloon_sprite.visible = true
end
update_balloon
end
#--------------------------------------------------------------------------
def update_balloon
if @balloon_duration > 0
@balloon_duration -= 1
if @balloon_duration == 0
@balloon_duration = 8 * 8 + BALLOON_WAIT
@balloon_duration -= 1
else
@balloon_sprite.x = x + EMO_X
@balloon_sprite.y = y + EMO_Y
@balloon_sprite.z = z + 50
if @balloon_duration < BALLOON_WAIT
sx = 7 * 32
else
sx = (7 - (@balloon_duration - BALLOON_WAIT) / 8) * 32
end
sy = (@balloon_face - 1) * 32
@balloon_sprite.src_rect.set(sx, sy, 32, 32)
end
end
end
#--------------------------------------------------------------------------
def dispose_balloon
if @balloon_sprite != nil
@balloon_sprite.dispose
@balloon_sprite = nil
end
end
#--------------------------------------------------------------------------
alias inc_terminate_message terminate_message
def terminate_message
inc_terminate_message
@balloon_sprite.visible = false
end
#--------------------------------------------------------------------------
alias inc_convert_special_characters convert_special_characters
def convert_special_characters
inc_convert_special_characters
@text.gsub!(/\E\[([0-9]+)\]/i) { "\x09[#{$1}]" }
end
#--------------------------------------------------------------------------
def update_message
loop do
c = @text.slice!(/./m) # ???????
case c
when nil # ??????????
finish_message # ????
break
when "\x00" # ??
new_line
if @line_count >= MAX_LINE # ????????
unless @text.empty? # ??????????
self.pause = true # ????????
break
end
end
when "\x01" # \C[n] (?????)
@text.sub!(/\[([0-9]+)\]/, "")
contents.font.color = text_color($1.to_i)
next
when "\x02" # \G (?????)
@gold_window.refresh
@gold_window.open
when "\x03" # \. (???? 1/4 ?)
@wait_count = 15
break
when "\x04" # \| (???? 1 ?)
@wait_count = 60
break
when "\x05" # \! (????)
self.pause = true
break
when "\x06" # \> (???? ON)
@line_show_fast = true
when "\x07" # \< (???? OFF)
@line_show_fast = false
when "\x08" # \^ (??????)
@pause_skip = true
when "\x09"
@text.sub!(/\[([0-9]+)\]/, "")
unless $game_message.face_name.empty?
@balloon_face = $1.to_i
refresh_balloon
end
else # ?????
contents.draw_text(@contents_x, @contents_y, 40, WLH, c)
c_width = contents.text_size(c).width
@contents_x += c_width
end
break unless @show_fast or @line_show_fast
end
end
end
Merci à RPG Creative | |
|