| 赞 | 46 |
| VIP | |
| 好人卡 | |
| 积分 | 97 |
| 经验 | |
| 最后登录 | 2026-6-17 |
| 在线时间 | 2775 小时 |
梦石0
星屑9716
在线时间2775 小时
注册时间2008-9-5
回帖3458
   
|
发表于 2015-12-2 16:50:58
|
显示全部楼层
本帖最后由 cinderelmini 于 2015-12-2 16:55 编辑
直接码的脚本,不知道是不是有问题,使用了变量1,2,3号(自己可以在脚本里的【refresh】里面改),
1号开关打开的时候窗口显示,否则消失(开关编号在脚本里的【update】里面改)。唔……大概就这样吧……
Main前Insert
- class Window_Values < Window_Base
- def initialize
- super(640 - window_width, 480 - window_height, window_width, window_height)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.back_opacity = 180
- self.visible = $game_switches[1]
- refresh
- end
-
- def refresh
- self.contents.clear
- @value_a = $game_variables[1]
- @value_b = $game_variables[2]
- @value_c = $game_variables[3]
- self.contents.draw_text(0, 32 * 0, window_width - 32, 32, "变量文字1:")
- self.contents.draw_text(0, 32 * 0, window_width - 32, 32, @value_a.to_s, 2)
- self.contents.draw_text(0, 32 * 1, window_width - 32, 32, "变量文字2:")
- self.contents.draw_text(0, 32 * 1, window_width - 32, 32, @value_b.to_s, 2)
- self.contents.draw_text(0, 32 * 2, window_width - 32, 32, "变量文字3:")
- self.contents.draw_text(0, 32 * 2, window_width - 32, 32, @value_c.to_s, 2)
- end
-
- def need_refresh?
- return @value_a != $game_variables[1] ||
- @value_b != $game_variables[2] ||
- @value_c != $game_variables[3]
- end
-
- def update
- super
- self.visible = $game_switches[1] if self.visible != $game_switches[1]
- refresh if need_refresh?
- end
-
- def window_width
- return 144 + 32
- end
-
- def window_height
- return 32 * 3 + 32
- end
- end
- class Scene_Map
- alias sn_151202_main main
- def main
- @values_window = Window_Values.new
- sn_151202_main
- @values_window.dispose
- end
-
- alias sn_151202_update update
- def update
- @values_window.update
- sn_151202_update
- end
- end
复制代码 |
评分
-
查看全部评分
|