【VX/VA】显示图片加强
这算是个人的第一个原创功能脚本了,VX、VA可用#==============================================================================
# 显示图片加强
# BY:仲秋启明
# 使用方法:事件脚本中加入
# 图片繁茂度:
# $game_map.screen.pictures.bush_depth = X
# $game_map.screen.pictures.bush_move(X,帧数)
# 图片翻转:
# $game_map.screen.pictures.mirror = true
# $game_map.screen.pictures.mir_move(true,帧数)
#==============================================================================
#==============================================================================
# ■ Game_Picture
#==============================================================================
class Game_Picture
attr_accessor :mirror # 翻转
attr_accessor :bush_depth # 繁茂度
alias initializemirror initialize
def initialize(number)
initializemirror(number)
@mirror = false # 翻转
@move_mirror = false # 翻转标志
@mirror_duration = 0 # 翻转时间
@mirror_duration_half = 0# 翻转点
@mirror_zoom = 0 # 翻转缩放量
@bush_depth = 0 # 繁茂度
@move_bush = 0 # 繁茂增量
@bush_duration = 0 # 繁茂变化时间
end
#--------------------------------------------------------------------------
# ● 翻转移动
#--------------------------------------------------------------------------
def mir_move(mir,duration)
return if @mirror == mir
@mirror_duration_half = duration / 2
@mirror_duration = @mirror_duration_half * 2
@mirror_zoom = @zoom_x / @mirror_duration_half
@move_mirror = mir
return
end
#--------------------------------------------------------------------------
# ● 繁茂移动
#--------------------------------------------------------------------------
def bush_move(depth,duration)
return if duration == 0
@move_bush = (depth - @bush_depth).to_f / duration
@bush_duration = duration
return
end
alias updatemirrorupdate
def update
updatemirror
if @mirror_duration > 0
if @move_mirror == @mirror
@zoom_x += @mirror_zoom
else
@zoom_x -= @mirror_zoom
end
@mirror_duration -= 1
if @mirror_duration == @mirror_duration_half
@mirror = @move_mirror
end
end
if @bush_duration > 0
@bush_depth += @move_bush
@bush_duration -= 1
end
end
end
#==============================================================================
# ■ Sprite_Picture
#==============================================================================
class Sprite_Picture < Sprite
alias updatemirrorupdate
def update
self.mirror = @picture.mirror
self.bush_depth = @picture.bush_depth
updatemirror
end
end
页:
[1]