赞 | 7 |
VIP | 866 |
好人卡 | 185 |
积分 | 32 |
经验 | 130059 |
最后登录 | 2024-11-27 |
在线时间 | 3618 小时 |
Lv3.寻梦者 双子人
- 梦石
- 0
- 星屑
- 3190
- 在线时间
- 3618 小时
- 注册时间
- 2009-4-4
- 帖子
- 4154
|
- class Win_Var < Window_Base
- def initialize(varid,varname = "")
- super(0,0,160,64)
- @varid = varid
- @number = $game_variables[@varid].to_s
- @varname = varname
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- def refresh
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(0, 0, 80, 32, @varname)
- self.contents.draw_text(80, 0, 80, 32, @number,1)
- end
- def judge#防止数据更变,节约内存
- return true if @number != $game_variables[@varid].to_s
- return false
- end
- def update
- if judge
- super
- @number = $game_variables[@varid].to_s
- refresh
- end
- end
- end
- class Scene_Battle
- alias hys_var_window_main main
- def main
- @window_var = Win_Var.new(1,"变量名称")#在此设置(变量编号,变量名称[可以为空])
- hys_var_window_main
- @window_var.dispose
- end
- alias hys_var_window_update update
- def update
- @window_var.update
- hys_var_window_update
- end
- end
复制代码 写完 |
|