赞 | 0 |
VIP | 7 |
好人卡 | 1 |
积分 | 1 |
经验 | 4577 |
最后登录 | 2023-11-6 |
在线时间 | 169 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 100
- 在线时间
- 169 小时
- 注册时间
- 2007-8-12
- 帖子
- 203
|
本帖最后由 心雪 于 2011-4-17 12:17 编辑
- class Window_Base
- def setup_skinname(v)
- self.windowskin = RPG::Cache.windowskin(v)
- end
- end
- class Scene_Skin
- def main
- @tip = Window_Base.new(0,0,640,96)
- @tip.contents = Bitmap.new(640-32,64)
- @tip.contents.draw_text(0,0,640,32,"请将皮肤文件放入Graphics\\Windowskins文件夹下(JPG or PNG)")
- @tip.contents.draw_text(0,32,640,32,"您要选择哪个窗口文件?")
- @filelist = Dir["Graphics//Windowskins//*.png"]
- @filelist += Dir["Graphics//Windowskins//*.jpg"]
- @filelist.sort!
- @filelist.each{|s|s["Graphics//Windowskins//"] = ""}
- #p @filelist
- #p Dir["Graphics//Windowskins//*.*"]
- if @filelist.size != 0
- @choose = Window_Command.new(640,@filelist)
- else
- @choose = Window_Command.new(640,["无文件"])
- @choose.disable_item(0)
- end
- @choose.height = 480-96
- @choose.x = 0
- @choose.y = 96
- @old_index = @choose.index
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话的就中断循环
- if $scene != self
- break
- end
- end
- Graphics.freeze
- @choose.dispose
- @tip.dispose
- end
- def update
- @choose.update
- if Input.trigger?(Input::C)
- if @filelist.size == 0
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- $game_system.se_play($data_system.decision_se)
- @skin_name = @filelist[@choose.index]
- $game_system.windowskin_name = @skin_name
- @tip.setup_skinname(@skin_name)
- @choose.setup_skinname(@skin_name)
- $scene = Scene_Map.new
- end
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换的地图画面
- $scene = Scene_Map.new
- return
- end
- if @old_index != @choose.index
- @old_index = @choose.index
- @skin_name = @filelist[@choose.index]
- @tip.setup_skinname(@skin_name)
- @choose.setup_skinname(@skin_name)
- end
- end
- end
复制代码 调用方法:事件第三页脚本$scene = Scene_Skin.new
原来小旅酱已经先咱一步了么> < |
|