赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 0 |
最后登录 | 2009-6-2 |
在线时间 | 0 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 540
- 在线时间
- 0 小时
- 注册时间
- 2009-5-30
- 帖子
- 2
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
怎样用开关来控制一个窗口的显示与关闭?
比如说下面这个脚本所显示的窗口
- $variables_id = 2
- $icon_index = 0
- class Window_Gold < Window_Base
- def initialize (x, y)
- super(160, 32, 352, 192)
- self.opacity = 200
- self.back_opacity = 200
- self.contents_opacity = 255
- @icon = 0
- @variable = 0
- refresh
- end
- def refresh
- self.contents.clear
- draw_icon($icon_index + 219,0,0,true)
- draw_icon($icon_index + 216,0,28,true)
- draw_icon($icon_index + 217,0,56,true)
- draw_icon($icon_index + 219,296,0,true)
- draw_icon($icon_index + 216,296,28,true)
- draw_icon($icon_index + 217,296,56,true)
- self.contents.draw_text(16,0,64,24,$game_variables[$variables_id + 4].to_s,2)
- self.contents.draw_text(16,28,64,24,$game_variables[$variables_id + 5].to_s,2)
- self.contents.draw_text(16,56,64,24,$game_variables[$variables_id + 6].to_s,2)
- self.contents.draw_text(220,0,64,24,$game_variables[$variables_id + 10].to_s,3)
- self.contents.draw_text(220,28,64,24,$game_variables[$variables_id + 11].to_s,3)
- self.contents.draw_text(220,56,64,24,$game_variables[$variables_id + 12].to_s,3)
- @icon = $icon_index
- @variable = $game_variables[$variables_id]
- end
- end
复制代码
或者这种自定义窗口
要怎样才可以用开关控制
- $variables_id = 2
- $icon_index = 0
- class Window_Azd < Window_Base
- def initialize
- super(160, 32, 352, 192)
- self.opacity = 150
- self.back_opacity = 150
- @icon = 0
- @variable = 0
- refresh
- end
- def refresh
- self.contents.clear
- draw_icon($icon_index + 219,0,0,true)
- draw_icon($icon_index + 216,0,28,true)
- draw_icon($icon_index + 217,0,56,true)
- draw_icon($icon_index + 219,296,0,true)
- draw_icon($icon_index + 216,296,28,true)
- draw_icon($icon_index + 217,296,56,true)
- self.contents.draw_text(16,0,64,24,$game_variables[$variables_id + 4].to_s,2)
- self.contents.draw_text(16,28,64,24,$game_variables[$variables_id + 5].to_s,2)
- self.contents.draw_text(16,56,64,24,$game_variables[$variables_id + 6].to_s,2)
- self.contents.draw_text(220,0,64,24,$game_variables[$variables_id + 10].to_s,3)
- self.contents.draw_text(220,28,64,24,$game_variables[$variables_id + 11].to_s,3)
- self.contents.draw_text(220,56,64,24,$game_variables[$variables_id + 12].to_s,3)
- @icon = $icon_index
- @variable = $game_variables[$variables_id]
- end
- end
- class Scene_Map < Scene_Base
- alias new_start start
- def start
- new_start
- @azd_window = Window_Azd.new
- end
- alias new_update update
- def update
- new_update
- @azd_window.refresh
- end
- alias new_terminate terminate
- def terminate
- @azd_window.dispose
- new_terminate
- end
- end
复制代码 |
|