赞 | 0 |
VIP | 0 |
好人卡 | 18 |
积分 | 1 |
经验 | 14606 |
最后登录 | 2012-11-16 |
在线时间 | 273 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 273 小时
- 注册时间
- 2011-5-20
- 帖子
- 295
|
- $default_winskin = "Window" # 默认窗口外观
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # ● 更改窗口外观
- #--------------------------------------------------------------------------
- def change_windowskin(winskin=nil)
- if winskin
- # 设定素材名称
- $game_system.windowskin_name = winskin
- else
- # 回复默认名称
- $game_system.windowskin_name = $default_winskin
- end
- return true
- end
- end
- class Game_System
- #--------------------------------------------------------------------------
- # ● 获取窗口外观名称
- #--------------------------------------------------------------------------
- def windowskin_name
- if @windowskin_name == nil
- return $default_winskin
- else
- return @windowskin_name
- end
- end
- #--------------------------------------------------------------------------
- # ● 更改窗口外观名称
- #--------------------------------------------------------------------------
- def windowskin_name=(winskin)
- @windowskin_name = winskin
- end
- end
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- alias winskin_initialize initialize
- def initialize(x, y, width, height)
- winskin_initialize(x, y, width, height)
- @windowskin_name = $game_system.windowskin_name
- self.windowskin = Cache.system(@windowskin_name)
- end
- #--------------------------------------------------------------------------
- # ● 更新窗口
- #--------------------------------------------------------------------------
- alias winskin_update update
- def update
- winskin_update
- if $game_system.windowskin_name != @windowskin_name
- @windowskin_name = $game_system.windowskin_name
- self.windowskin = Cache.system(@windowskin_name)
- end
- end
- end
复制代码 使用方法:事件内用脚本指令, 打入
change_windowskin("素材名称")
回复默认:
change_windowskin |
|