赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 6367 |
最后登录 | 2020-9-11 |
在线时间 | 69 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 65
- 在线时间
- 69 小时
- 注册时间
- 2016-8-19
- 帖子
- 32
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
#==============================================================================
# ■ RGSS3 マップズーム Ver1.00 by 星潟
# ■ RGSS3 地图缩放 Ver1.00 by 星潟 翻译:戏蹑群星斗
#------------------------------------------------------------------------------
#地图缩放。就是这样。
#由于缩放状态保存的数据将被保留(就是存档会保留缩放)。请注意
#==============================================================================
# 使用事件命令的脚本。
#------------------------------------------------------------------------------
# map_zoom(150)
## 在这种情况下,它会放大到150%。
#------------------------------------------------------------------------------
# map_zoom(300)
## 在这种情况下,它会放大到300%。
#------------------------------------------------------------------------------
# map_zoom
## 在这种情况下,放大解除。
#==============================================================================
# 100未満のズーム(縮小)や2000%を超えるのズームには制限をかけてあります。
# 因此,100是最小值,最大值2000。
#==============================================================================
class Game_System
attr_accessor :zoom_mode
#--------------------------------------------------------------------------
# ズームモード
#--------------------------------------------------------------------------
def zoom_mode
@zoom_mode ||= 100
end
end
class Spriteset_Map
#--------------------------------------------------------------------------
# ビューポートの作成
#--------------------------------------------------------------------------
alias create_viewports_zoommap create_viewports
def create_viewports
create_viewports_zoommap
@zoommap = ZoomMap.new(@viewport1,@viewport2)
end
#--------------------------------------------------------------------------
# 更新処理
#--------------------------------------------------------------------------
alias update_zoommap update
def update
@zoommap.update
update_zoommap
end
#--------------------------------------------------------------------------
# 解放処理
#--------------------------------------------------------------------------
alias dispose_zoommap dispose
def dispose
@zoommap.dispose
dispose_zoommap
end
end
class ZoomMap < Sprite_Base
#--------------------------------------------------------------------------
# 初期化
#--------------------------------------------------------------------------
def initialize(v1,v2)
super(v2)
@viewport_data = v1
@zoom_rate = $game_system.zoom_mode
@zoom_bitmap = nil
end
#--------------------------------------------------------------------------
# 解放
#--------------------------------------------------------------------------
def dispose
@zoom_bitmap.dispose if @zoom_bitmap && !@zoom_bitmap.disposed?
super
end
#--------------------------------------------------------------------------
# 更新処理
#--------------------------------------------------------------------------
def update
self.visible = @zoom_rate != 100
@zoom_bitmap.dispose if @zoom_bitmap && !@zoom_bitmap.disposed?
if $game_system.zoom_mode != 100 or @zoom_rate != 100
if @zoom_rate != $game_system.zoom_mode
d = (@zoom_rate - $game_system.zoom_mode).to_i
case d
when 0..9;i = 1
when 10..99;i = 2
when 100..999;i = 3
else; i = 4
end
@zoom_rate += (@zoom_rate < $game_system.zoom_mode) ? i : -i
end
zm = @zoom_rate.to_f / 100
@viewport_data.z += 1000
@zoom_bitmap = Graphics.snap_to_bitmap
self.bitmap = @zoom_bitmap
w = self.bitmap.width
h =self.bitmap.height
self.ox = [[0,((w * zm / 2) - w / 2) / zm + (($game_player.screen_x - w / 2).to_f)].max,(w * zm - w) / zm].min
self.oy = [[0,((h * zm / 2) - h / 2) / zm + (($game_player.screen_y - 16 - h / 2).to_f)].max,(h * zm - h) / zm].min
self.zoom_x = zm
self.zoom_y = zm
self.visible = true
@viewport_data.z -= 1000
end
super
end
end
class Game_Interpreter
#--------------------------------------------------------------------------
# ズーム
#--------------------------------------------------------------------------
def map_zoom(rate = 100)
$game_system.zoom_mode = [[rate,100].max,2000].min
end
end
以上是地图放大脚本
#===========================================================================
# ◆ A1 Scripts ◆
# 立ち絵表示(RGSS3)
#
# バージョン : 1.10 (2011/12/15)
# 作者 : A1
# URL : http://a1tktk.web.fc2.com/
#---------------------------------------------------------------------------
# 機能:
# ?「图片表示」之类的不使用也可以表示立绘?或不表示?或移動
#---------------------------------------------------------------------------
# 更新履歴 :2011/12/15 Ver1.00 リリース
#---------------------------------------------------------------------------
# 設置場所
# 放在RGSS3用A1共通スクリプト下面
# (ネームウィンドウ以下)
#
# 必要脚本
# RGSS3用A1共通处理
#---------------------------------------------------------------------------
# 使用方法
# 角色肖像图对应的立绘
# 放在Pictures文件夹里就可以作用
#
# 对应立绘的名字是
# [角色肖像图名]_[角色肖像图序号]_[0 or 1]
#
# 例:角色肖像图 Actor1 的Index 0 (ラルフ) 的时候
# Actor1_0_0 就变成了对应的立绘
# Actor1_0_1 有的话就会对口型
#
# 立绘表示フラグをOnにすると、立绘就可以被表示
# 立绘表示フラグの番号は設定項目で設定できます
#
# 更换名称
# 设定项目的「更换名称」设定了的话
# 角色肖像图文件的名字和表示する立ちグラフィックの関連付けができます
#
# 例1(一个角色肖像图文件使多个角色使用的情况下)
# "Actor1" => [["ラルフ",0],["アリシア",0],nil,nil,
# nil, nil, nil,nil],
#
# 表示角色肖像图文件「Actor1」为index0的时候
# ラルフ_0_0 就变成了对应的立绘
# ラルフ_0_1 有的话就会对口型
#
# 表示「Actor1」为Index1的时候
# アリシア_0_0 就变成了对应的立绘
# アリシア_0_1 有的话就会对口型
#
# 例2(多个角色肖像图文件用在一个角色上的情况下)
# "ラルフ" => [["ラルフ",0]] (省略可能)
# "ラルフ_ex" => [["ラルフ",1]]
#
# 角色肖像图文件与「ラルフ」「ラルフ_ex」对应了
# 将所有的立绘、作为「ラルフ」的立绘对待
#---------------------------------------------------------------------------
# 追加文章中コマンド
#
# \TURN[direction] 立绘左右反转
# direction = 指定朝向 (L or R)
#
# L : 将原来的立绘反转
# R : 反转了的原来的立绘还原
# 使用例:\TURN[L]
#
# \RETURN[duration] 还原立绘所定的位置
# duration = 直到移动完成的时间(帧数)
#
# \ERASE 消去立绘
#
# \SHOW 表示消去了的立绘
#
# \TONE[duration,red,green,blue,gray]
# 立绘的色调变更
# duration = 直到变更完成的时间(帧数)
# red = 色调的红度
# green = 色调的绿度
# blue = 色调的蓝度
# gray = 色调的灰度(省略可)
#
# \MV[x,y,duration] 立绘移动(絶対座標)
# x = 移動前的x座標
# y = 移動前的y座標
# duration = 直到移動完成的时间(帧数)
#
# \MVA[x,y,duration] 立绘移动(相対座標)
# x = x方向的移动距离
# y = y方向的移动距离
# duration = 直到移動完成的时间(帧数)
#
# \OP[opacity,duration] 立绘的透明度变更
# opacity = 透明度
# duration = 直到透明度变更完成的时间(帧数)
#
#
# \BYE[direction,duration] 让立绘向画面外移动
# direction = 方向指定 (L or R or D)
# duration = 直到移动完成的时间(帧数)
#
# L : 画面左退場
# R : 画面右退場
# D : 画面下退場
# 使用例:\BYE[L,60]
#==============================================================================
$imported ||= {}
$imported["A1_Stand_Picture"] = true
if $imported["A1_Common_Script"]
#==============================================================================
# ■ 設定項目
#==============================================================================
module A1_System::StandPicture
# 名字的调换
NAME_CHANGE = {
"Actor1" => [["ラルフ",0],["アリシア",0],nil,nil,
nil, nil, nil,nil],
}
end
#==============================================================================
# ■ Window_Message
#------------------------------------------------------------------------------
# 这是用于表示文章的窗口
#==============================================================================
class Window_Message < Window_Base
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
LEFT = 0
RIGHT = 1
BYE_DURATION = 30
MOVE_DURATION = 30
#--------------------------------------------------------------------------
# ☆ 对象初期化
#--------------------------------------------------------------------------
alias a1_stand_picture_window_message_initialize initialize
def initialize
@stand_pic = {}
@show_pos = []
@prev_name = ""
@pre_message = false
a1_stand_picture_window_message_initialize
end
#--------------------------------------------------------------------------
# ☆ 换页处理
#--------------------------------------------------------------------------
alias a1_stand_picture_window_message_new_page new_page
def new_page(text, pos)
file_name = $game_message.face_name
file_index = $game_message.face_index
file_info = find_name(file_name, file_index)
name = file_info[0]
index = file_info[1]
# 没有角色肖像图
if name.empty?
# 直到现在[译者:或翻译成以前、照旧]的换页处理
a1_stand_picture_window_message_new_page(text, pos)
return
# 有角色肖像图
else
# 立绘作成(新脸的话表示)
new_face = false
new_face = create_stand_pic(file_name, name, index) if @stand_pic[name] == nil
# 没有立绘
unless stand_pic_enable?(name)
# 直到现在[译者:或翻译成以前、照旧]的换页处理
a1_stand_picture_window_message_new_page(text, pos)
return
end
end
unless new_face
if show_pos(name) > -1
# 角色肖像图变更
@stand_pic[name].change_face(file_name, index)
elsif @show_pos.size == 2
change_character(file_name, name, index)
else
create_stand_pic(file_name, name, index)
end
end
# 角色肖像图を一度emptyにする
$game_message.face_name = "" if @stand_pic[name].enable_bitmap?(index)
# 直到现在[译者:或翻译成以前、照旧]的换页处理
a1_stand_picture_window_message_new_page(text, pos)
# 还原角色肖像图
$game_message.face_name = file_name
# 直前に話した名前を入れる
@prev_name = name
if $imported["A1_Name_Window"]
pos = show_pos(name)
unless stand_pic_enable?(name)
show_name_window(file_name, file_index, 0)
else
bitmap_width = @stand_pic[name].pic_sprite.bitmap.width
x = bitmap_width / 2 if pos == 0
x = Graphics.width - bitmap_width / 2 if pos == 1
show_name_window(file_name, file_index, x, 0)
end
end
end
#--------------------------------------------------------------------------
# ☆ 改行处理
#--------------------------------------------------------------------------
alias a1_stand_picture_window_message_new_line_x new_line_x
def new_line_x
file_name = $game_message.face_name
file_index = $game_message.face_index
file_info = find_name(file_name, file_index)
name = file_info[0]
index = file_info[1]
# 没有角色肖像图
if name.empty?
# 直到现在[译者:或翻译成以前、照旧]的改行处理
return a1_stand_picture_window_message_new_line_x
end
# 没有立绘
unless stand_pic_enable?(name)
# 直到现在[译者:或翻译成以前、照旧]的改行处理
return a1_stand_picture_window_message_new_line_x
end
# 将角色肖像图一次empty
$game_message.face_name = "" if @stand_pic[name].enable_bitmap?(index)
# 直到现在[译者:或翻译成以前、照旧]的改行处理
ret = a1_stand_picture_window_message_new_line_x
# 还原角色肖像图
$game_message.face_name = file_name
return ret
end
#--------------------------------------------------------------------------
# ○ 立绘作成
#--------------------------------------------------------------------------
def create_stand_pic(file_name, name, index, duration = MOVE_DURATION)
@stand_pic[name] = Game_StandPic.new(name, index)
return if @stand_pic[name].pic_sprite == nil
return unless $game_system.show_stand_picture
if @show_pos.size == 0
pos = LEFT
@show_pos[0] = name
elsif @show_pos.size == 1
pos = RIGHT
@show_pos[1] = name
else
change_character(file_name, name, index)
return true
end
@stand_pic[name].show(file_name, pos,index, duration)
return true
end
#--------------------------------------------------------------------------
# ○ 变更表示的立绘
#--------------------------------------------------------------------------
def change_character(file_name, name, index, duration = MOVE_DURATION)
return if @stand_pic[name].pic_sprite == nil
return unless $game_system.show_stand_picture
no_index = no_prev_index
no_prev_name = @show_pos[no_index]
case no_index
when 0
@stand_pic[no_prev_name].bye("L",BYE_DURATION) if stand_pic_enable?(no_prev_name)
pos = LEFT
@show_pos[0] = name
when 1
@stand_pic[no_prev_name].bye("R",BYE_DURATION) if stand_pic_enable?(no_prev_name)
pos = RIGHT
@show_pos[1] = name
end
@stand_pic[name].show(file_name, pos,index, duration) if stand_pic_enable?(name)
end
#--------------------------------------------------------------------------
# ○ 直前に話していないIndexを取得
#--------------------------------------------------------------------------
def no_prev_index
return 0 if @show_pos[0] != @prev_name
return 1 if @show_pos[1] != @prev_name
end
#--------------------------------------------------------------------------
# ○ 检查是否表示
#--------------------------------------------------------------------------
def show_pos(name)
return 0 if @show_pos[0] == name
return 1 if @show_pos[1] == name
return -1
end
#--------------------------------------------------------------------------
# ☆ 更新帧数
#--------------------------------------------------------------------------
alias a1_stand_pic_window_message_update update
def update
update_stand_pic
a1_stand_pic_window_message_update
end
#--------------------------------------------------------------------------
# ○ 立绘的update
#--------------------------------------------------------------------------
def update_stand_pic
for name in @stand_pic.keys
@stand_pic[name].update
end
end
#--------------------------------------------------------------------------
# ○ 文章的check
#--------------------------------------------------------------------------
alias a1_stand_pic_wm_chk_text chk_text
def chk_text(text)
text.gsub!(/\eERASE/,"")
text.gsub!(/\eSHOW/,"")
return a1_stand_pic_wm_chk_text(text)
end
#--------------------------------------------------------------------------
# ☆ 文字控制的处理
# code : 文字控制的本体部分(「\C[1]」なら「C」)
# text : 描画处理中的文字列buffer(必要的话破坏性地変更)
# pos : 描画位置 {:x, :y, :new_x, :height}
#--------------------------------------------------------------------------
alias a1_stand_pic_wm_process_escape_character process_escape_character
def process_escape_character(code, text, pos)
file_name = $game_message.face_name
file_index = $game_message.face_index
file_info = find_name(file_name, file_index)
name = file_info[0]
index = file_info[1]
case code.upcase
when 'TURN'
text.slice!(/\[(.)\]/) rescue 0
if stand_bitmap_enable?(name, index)
case $1
when 'L'
@stand_pic[name].pic_sprite.mirror = true
when 'R'
@stand_pic[name].pic_sprite.mirror = false
end
end
return true
when 'RETURN'
text.slice!(/\[(\d+)\]/) rescue 0
if stand_bitmap_enable?(name, index)
index = show_pos(name)
return if index == -1
duration = $1.to_i
@stand_pic[name].return_pos(index, duration)
end
when 'SHOW'
if stand_bitmap_enable?(name, index)
return if @stand_pic[name].pic_sprite == nil or name.empty?
@stand_pic[name].pic_sprite.visible = true
end
when 'ERASE'
if stand_bitmap_enable?(name, index)
return if @stand_pic[name].pic_sprite == nil or name.empty?
@stand_pic[name].pic_sprite.visible = false
end
when 'TONE'
text.slice!(/\[(.+)\]/) rescue 0
if stand_bitmap_enable?(name, index)
params = $1.to_s.split(",")
duration = params[0].to_i
red = $a1_common.minus_to_i(params[1])
green = $a1_common.minus_to_i(params[2])
blue = $a1_common.minus_to_i(params[3])
gray = $a1_common.minus_to_i(params[4]) unless params[4] == nil
if gray == nil
tone = Tone.new(red, green, blue)
else
tone = Tone.new(red, green, blue, gray)
end
@stand_pic[name].start_tone_change(tone, duration)
end
when 'MV'
text.slice!(/\[([-]*\d+)[,]([-]*\d+)[,](\d+)\]/) rescue 0
if stand_bitmap_enable?(name, index)
x = $a1_common.minus_to_i($1)
y = $a1_common.minus_to_i($2)
duration = $3.to_i
@stand_pic[name].move(x, y, duration)
end
when 'MVA'
text.slice!(/\[([-]*\d+)[,]([-]*\d+)[,](\d+)\]/) rescue 0
if stand_bitmap_enable?(name, index)
x = $a1_common.minus_to_i($1)
y = $a1_common.minus_to_i($2)
duration = $3.to_i
@stand_pic[name].move_plus(x, y, duration)
end
when 'OP'
text.slice!(/\[(\d+)[,](\d+)\]/) rescue 0
if stand_bitmap_enable?(name, index)
@stand_pic[name].change_opacity($1.to_i,$2.to_i)
end
when 'BYE'
text.slice!(/^\[(.)[,](\d+)\]/) rescue 0
if stand_bitmap_enable?(name, index)
@show_pos.delete_at(show_pos(name))
@stand_pic[name].bye($1,$2.to_i)
end
else
a1_stand_pic_wm_process_escape_character(code, text, pos)
end
end
#--------------------------------------------------------------------------
# ☆ 通常文字的处理
#--------------------------------------------------------------------------
alias a1_stand_pic_wm_process_normal_character process_normal_character
def process_normal_character(c, pos)
file_name = $game_message.face_name
file_index = $game_message.face_index
file_info = find_name(file_name, file_index)
name = file_info[0]
index = file_info[1]
if stand_bitmap_enable?(name, index)
@stand_pic[name].mouth_move
end
a1_stand_pic_wm_process_normal_character(c, pos)
end
#--------------------------------------------------------------------------
# ○ 立绘有效?
#--------------------------------------------------------------------------
def stand_pic_enable?(name)
return false if name.empty?
return false if @stand_pic[name] == nil
return false if @stand_pic[name].pic_sprite == nil
return false unless $game_system.show_stand_picture
return true
end
#--------------------------------------------------------------------------
# ○ bitmap有効?
#--------------------------------------------------------------------------
def stand_bitmap_enable?(name, index)
return false if name.empty?
return false if @stand_pic[name].pic_sprite == nil
return false unless @stand_pic[name].enable_bitmap?(index)
return false unless $game_system.show_stand_picture
return true
end
#--------------------------------------------------------------------------
# ☆ 解放
#--------------------------------------------------------------------------
alias a1_stand_pic_window_message_dispose dispose
def dispose
a1_stand_pic_window_message_dispose
dispose_stand_picture
end
#--------------------------------------------------------------------------
# ○ 立絵解放
#--------------------------------------------------------------------------
def dispose_stand_picture
for name in @stand_pic.keys
@stand_pic[name].erase
end
end
#--------------------------------------------------------------------------
# ○ 名字检索
#--------------------------------------------------------------------------
def find_name(filename, fileindex)
list = A1_System::StandPicture::NAME_CHANGE[filename]
return [filename,fileindex] if list == nil
if list.size == 1
info = list[0]
return [info[0],info[1]*8+fileindex]
end
return [filename,fileindex] if list[fileindex] == nil
return list[fileindex]
end
end
#==============================================================================
# ■ Game_StandPic
#==============================================================================
class Game_StandPic
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
LEFT = 0
RIGHT = 1
MOVE_DURATION = 30
MOUTH_MOVE_DURATION = 4
#--------------------------------------------------------------------------
# ● 公開实例変数
#--------------------------------------------------------------------------
attr_reader :x # X 座標
attr_reader :y # Y 座標
attr_reader :opacity # 不透明度
attr_reader :tone # 色調
attr_reader :mirror # 左右反转
attr_reader :pic_sprite # Sprite
attr_reader :bitmap # bitmap的配列
#--------------------------------------------------------------------------
# ● 对象初期化
# number : 图片号码
#--------------------------------------------------------------------------
def initialize(name, index)
@name = name
@duration = 0
@target_opacity = 255.0
@tone = Tone.new(0, 0, 0, 0)
@tone_target = Tone.new(0, 0, 0, 0)
@tone_duration = 0
@mirror = false
@pic_sprite = nil
@face_index = 0
@mouth_index = 0
@mouth_move_duration = 0
@pos = -1
@bitmap = []
@bitmap_test = []
plus = (index / 8) * 8
create_bitmap(name, plus)
@pic_sprite = create_sprite if @bitmap.size > 0
end
#--------------------------------------------------------------------------
# ● Sprite作成
#--------------------------------------------------------------------------
def create_sprite
pic_sprite = Sprite.new
pic_sprite.visible = false
return pic_sprite
end
#--------------------------------------------------------------------------
# ● bitmap作成
#--------------------------------------------------------------------------
def create_bitmap(name, plus = 0)
file = sprintf("Graphics/Pictures/%s",name)
Dir::glob(sprintf("%s*.*",file)).each {|f|
next unless f =~ /#{file}_(\d+)_(\d+)/i
next unless FileTest.file?(f)
next unless file_ext(f)
index = $1.to_i + plus
@bitmap[index] = [] if @bitmap[index] == nil
file_name = File.basename(f,".*")
@bitmap[index][$2.to_i] = Cache.picture(file_name)
@bitmap_test[index] = true
}
end
#--------------------------------------------------------------------------
# ● 调查后缀
#--------------------------------------------------------------------------
def file_ext(f)
return true if File::extname(f) == ".png"
return true if File::extname(f) == ".bmp"
return false
end
#--------------------------------------------------------------------------
# ● 调查bitmap的存在
#--------------------------------------------------------------------------
def enable_bitmap?(index)
return false if @bitmap[index] == nil
return true
end
#--------------------------------------------------------------------------
# ● 代替bitmap的检索
#--------------------------------------------------------------------------
def search_bitmap
for bitmap in @bitmap
next if bitmap == nil
return bitmap[0]
end
end
#--------------------------------------------------------------------------
# ● 图像表示
#--------------------------------------------------------------------------
def show(file_name, pos, index, duration, opacity = 255)
@face_index = index
@pos = pos
if @bitmap[@face_index] == nil and @bitmap_test[@face_index] != true
plus = (@face_index / 8) * 8
create_bitmap(file_name, plus)
end
if @bitmap[@face_index] == nil or $game_system.show_stand_picture == false
@pic_sprite.bitmap = nil
@pic_sprite.visible = false
bitmap = search_bitmap
else
@pic_sprite.visible = true
@pic_sprite.bitmap = @bitmap[@face_index][0]
bitmap = @pic_sprite.bitmap
end
fix_pos(pos, duration, bitmap, opacity)
return true
end
#--------------------------------------------------------------------------
# ● 場所確定
#--------------------------------------------------------------------------
def fix_pos(pos, duration, bitmap, opacity)
case pos
when LEFT
@pic_sprite.x = (0 - bitmap.width).to_f
@target_x = 0.0
@duration = duration
@pic_sprite.mirror = false
when RIGHT
@pic_sprite.x = Graphics.width.to_f
@target_x = (Graphics.width - bitmap.width).to_f
@duration = duration
@pic_sprite.mirror = true
end
@pic_sprite.opacity = opacity.to_f
@pic_sprite.visible = true
@pic_sprite.y = (Graphics.height - bitmap.height).to_f
@target_y = @pic_sprite.y
end
#--------------------------------------------------------------------------
# ● 还原到定位置
#--------------------------------------------------------------------------
def return_pos(pos, duration)
case pos
when LEFT
@target_x = 0.0
@duration = duration
@pic_sprite.mirror = false
when RIGHT
@target_x = (Graphics.width - @pic_sprite.bitmap.width).to_f
@duration = duration
@pic_sprite.mirror = true
end
@target_y = (Graphics.height - @pic_sprite.bitmap.height).to_f
end
#--------------------------------------------------------------------------
# ● 脸変更
#--------------------------------------------------------------------------
def change_face(name, index)
@face_index = index
if @bitmap[@face_index] == nil and @bitmap_test[@face_index] != true
plus = (@face_index / 8) * 8
create_bitmap(name, plus)
end
if @bitmap[@face_index] == nil or $game_system.show_stand_picture == false
@pic_sprite.bitmap = nil
@pic_sprite.visible = false
else
@pic_sprite.bitmap = @bitmap[@face_index][0]
case @pos
when LEFT
@pic_sprite.x = 0.0
when RIGHT
@pic_sprite.x = (Graphics.width - @pic_sprite.bitmap.width).to_f
end
@pic_sprite.y = (Graphics.height - @pic_sprite.bitmap.height).to_f
@target_x = @pic_sprite.x
@target_y = @pic_sprite.y
@pic_sprite.visible = true
end
end
#--------------------------------------------------------------------------
# ● 对嘴型
#--------------------------------------------------------------------------
def mouth_move
return if @mouth_move_duration > 0
return if bitmap[@face_index] == nil
return if bitmap[@face_index].size == 1
@mouth_move_duration = MOUTH_MOVE_DURATION
if @mouth_index == 0 and bitmap[@face_index][1] != nil
@mouth_index = 1
elsif @mouth_index == 1
@mouth_index = 0
end
@pic_sprite.bitmap = bitmap[@face_index][@mouth_index]
end
#--------------------------------------------------------------------------
# ● 图片移動
#--------------------------------------------------------------------------
def move(x, y, duration)
@target_x = x
@target_y = y
@duration = duration
end
#--------------------------------------------------------------------------
# ● 透明度変更
#--------------------------------------------------------------------------
def change_opacity(opacity, duration)
@target_opacity = opacity
@duration = duration
end
#--------------------------------------------------------------------------
# ● 相対移動
#--------------------------------------------------------------------------
def move_plus(x, y, duration)
@target_x = @pic_sprite.x + x
@target_y = @pic_sprite.y + y
@duration = duration
end
#--------------------------------------------------------------------------
# ● 退場
#--------------------------------------------------------------------------
def bye(direction, duration)
return if @pic_sprite.bitmap == nil
case direction
when "D"
@target_y = Graphics.height
when "R"
@target_x = Graphics.width
when "L"
@target_x = 0 - @pic_sprite.bitmap.width
end
@duration = duration
end
#--------------------------------------------------------------------------
# ● 色調変更開始
#--------------------------------------------------------------------------
def start_tone_change(tone, duration)
@tone_target = tone.clone
@tone_duration = duration
if @tone_duration == 0
@tone = @tone_target.clone
end
end
#--------------------------------------------------------------------------
# ● 图像消去
#--------------------------------------------------------------------------
def erase
for arr in @bitmap
next if arr == nil
for bitmap in arr
next if bitmap == nil
bitmap.dispose
end
end
@bitmap = nil
return if @pic_sprite == nil
@pic_sprite.dispose
@pic_sprite = nil
end
#--------------------------------------------------------------------------
# ● 帧数更新
#--------------------------------------------------------------------------
def update
return if @pic_sprite == nil
@mouth_move_duration -= 1 if @mouth_move_duration > 0
if @duration >= 1
d = @duration
@pic_sprite.x = (@pic_sprite.x * (d - 1) + @target_x) / d
@pic_sprite.y = (@pic_sprite.y * (d - 1) + @target_y) / d
@pic_sprite.opacity = (@pic_sprite.opacity * (d - 1) + @target_opacity) / d
@duration -= 1
end
if @tone_duration >= 1
d = @tone_duration
@tone.red = (@tone.red * (d - 1) + @tone_target.red) / d
@tone.green = (@tone.green * (d - 1) + @tone_target.green) / d
@tone.blue = (@tone.blue * (d - 1) + @tone_target.blue) / d
@tone.gray = (@tone.gray * (d - 1) + @tone_target.gray) / d
@tone_duration -= 1
@pic_sprite.tone = @tone
end
end
end
#==============================================================================
# ■ Game_System
#------------------------------------------------------------------------------
# 处理系统周遭的文件的class。交通工具和BGM之类的管理也在。
# 这个class的实例在 $game_system 里面被参照。
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ● 公開实例変数
#--------------------------------------------------------------------------
attr_accessor :show_stand_picture # 立绘表示FLAG
#--------------------------------------------------------------------------
# ☆ 对象初期化
#--------------------------------------------------------------------------
alias a1_stand_picture_game_system_initialize initialize
def initialize
a1_stand_picture_game_system_initialize
@show_stand_picture = false
end
end
#==============================================================================
# ■ Game_Interpreter
#------------------------------------------------------------------------------
# 实行事件指令的Interpreter。这个class在 Game_Map class、
# Game_Troop class、Game_Event class的内部里被使用。
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# ○ 注释处理
#--------------------------------------------------------------------------
alias a1_stand_picture_proc_comment_command proc_comment_command
def proc_comment_command(command, params)
if command == "立ち絵表示"
case params[0]
when "on"
$game_system.show_stand_picture = true
when "off"
$game_system.show_stand_picture = false
end
else
a1_stand_picture_proc_comment_command(command, params)
end
end
end
end
以上是动态立绘脚本
如果两个一起使用的话 立绘会直接无法显示
请问有没有什么两者可以兼容使用的方法呢! |
|