赞 | 4 |
VIP | 71 |
好人卡 | 22 |
积分 | 6 |
经验 | 32145 |
最后登录 | 2013-8-9 |
在线时间 | 184 小时 |
Lv2.观梦者 天仙
- 梦石
- 0
- 星屑
- 640
- 在线时间
- 184 小时
- 注册时间
- 2008-4-15
- 帖子
- 5023

|
- class Window_VariableWindow < Window_Base
- VISIBLE_ID = 1 # 可见性控制(开关ID)
- HP_ID = 1 # 显示HP的变量ID
- ATK_ID = 2 # 显示攻击的变量ID
- DEF_ID = 3 # 显示防御的变量ID
-
- def initialize
- super(0,0,200,110)
- self.opacity = 0
- self.visible = $game_switches[VISIBLE_ID]
- $game_variables[HP_ID] = $game_actors[1].hp
- $game_variables[ATK_ID] = $game_actors[1].atk
- $game_variables[DEF_ID] = $game_actors[1].def
-
- refresh
- end
- def refresh
- self.contents.clear
- draw_icon(137,0,0)
- self.contents.draw_text(25, 0, 40, WLH, $game_variables[HP_ID])
- draw_icon(1,0,24)
- self.contents.draw_text(25, 24, 40, WLH, $game_variables[ATK_ID])
- draw_icon(52,0,48)
- self.contents.draw_text(25, 48, 40, WLH, $game_variables[DEF_ID])
- end
- def update
- self.visible = $game_switches[VISIBLE_ID]
-
- if $game_actors[1].hp != $game_variables[HP_ID]
- refresh
- $game_variables[HP_ID] = $game_actors[1].hp
- end
-
- if $game_actors[1].atk != $game_variables[ATK_ID]
- refresh
- $game_variables[ATK_ID] = $game_actors[1].atk
- end
-
- if $game_actors[1].def != $game_variables[DEF_ID]
- refresh
- $game_variables[DEF_ID] = $game_actors[1].def
- end
- end
- end
- class Scene_Map < Scene_Base
- alias variable_start start
- alias variable_update update
- alias variable_terminate terminate
- def start
- variable_start
- @variableWindow = Window_VariableWindow.new
- end
- def update
- @variableWindow.update
- variable_update
- end
- def terminate
- variable_terminate
- @variableWindow.dispose
- end
- end
复制代码
修改完成,我不晓得原来的是谁写的,不过MS完全没用 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|