加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 金芒芒 于 2022-11-23 11:19 编辑
#============================================================================== # ■ Window_db #------------------------------------------------------------------------------ # 显示队标动画的窗口 #============================================================================== class Window_db9 < Window_Base #-------------------------------------------------------------------------- # ● 初始化目标 #-------------------------------------------------------------------------- def initialize super((640-60)/2-16, (480-90)/2-16-64, 60, 90) self.contents = Bitmap.new(width - 32, height - 32) @count = @kind = 0 # 隐藏窗口可见度 self.opacity = 0 self.z = 350 refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear # 队标显示 refresh_sprite(0, 0, @kind) end #--------------------------------------------------------------------------- # ● 刷新人物动态图 #--------------------------------------------------------------------------- def update super self.x = $game_player.screen_x-228 self.y = $game_player.screen_y+10 @count += 1 # 设置图片刷新速度 @count = 0 if @count >= 30 if @count / 2 != @kind @kind = @count / 2 refresh end end end #============================================================================== # ■ Window_Base #------------------------------------------------------------------------------ # 游戏中全部窗口的超级类。 #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ● 初始化对像 # x : 窗口的 X 坐标 # y : 窗口的 Y 坐标 # width : 窗口的宽 # height : 窗口的宽 #-------------------------------------------------------------------------- def refresh_sprite(x, y, kind) bitmap = RPG::Cache.picture("图片显示/动态图/队标") w = bitmap.width / 15 src_rect = Rect.new(kind * w, 0, w, bitmap.height) self.contents.blt(x, y, bitmap, src_rect) end end
#==============================================================================
# ■ Window_db
#------------------------------------------------------------------------------
# 显示队标动画的窗口
#==============================================================================
class Window_db9 < Window_Base
#--------------------------------------------------------------------------
# ● 初始化目标
#--------------------------------------------------------------------------
def initialize
super((640-60)/2-16, (480-90)/2-16-64, 60, 90)
self.contents = Bitmap.new(width - 32, height - 32)
@count = @kind = 0
# 隐藏窗口可见度
self.opacity = 0
self.z = 350
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# 队标显示
refresh_sprite(0, 0, @kind)
end
#---------------------------------------------------------------------------
# ● 刷新人物动态图
#---------------------------------------------------------------------------
def update
super
self.x = $game_player.screen_x-228
self.y = $game_player.screen_y+10
@count += 1
# 设置图片刷新速度
@count = 0 if @count >= 30
if @count / 2 != @kind
@kind = @count / 2
refresh
end
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 初始化对像
# x : 窗口的 X 坐标
# y : 窗口的 Y 坐标
# width : 窗口的宽
# height : 窗口的宽
#--------------------------------------------------------------------------
def refresh_sprite(x, y, kind)
bitmap = RPG::Cache.picture("图片显示/动态图/队标")
w = bitmap.width / 15
src_rect = Rect.new(kind * w, 0, w, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
end
角色HP值小于90%的时候,窗口10里面的图片透明为零, 角色HP值小于90%的时候,窗口10关闭。
链接: https://pan.baidu.com/s/14RT9XQRitZQaaQU6Yo9DeA?pwd=hvqc 提取码: hvqc |