#============================================================================== # ■ 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
对标.png (47.64 KB, 下载次数: 27)
条件判断.png (57.92 KB, 下载次数: 27)
对雪.png (62.43 KB, 下载次数: 24)
灯笼菜刀王 发表于 2022-11-23 10:29
在35行写上 self.visible = (a=($game_party.actors[0] || $game_actors[1])).hp >= a.maxhp * 0.9
灯笼菜刀王 发表于 2022-11-23 10:29
在35行写上 self.visible = (a=($game_party.actors[0] || $game_actors[1])).hp >= a.maxhp * 0.9
RPGzh500223 发表于 2022-11-23 11:31
不是,我就奇怪,怎么会把 Window对象 当 Sprite对象用啊,“黑米馒头”也这么写。
一般只是显示图像肯定首 ...
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |