Project1
标题: 每天一问,这里传送的脚本怎么把背景透明掉? [打印本页]
作者: he11120 时间: 2012-4-18 23:08
标题: 每天一问,这里传送的脚本怎么把背景透明掉?
本帖最后由 he11120 于 2012-4-18 23:35 编辑
如图,右边黑黑的变透明,能看见地图的那种!(好久没来提问好不习惯)
- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
- #$scene = Scene_Fei.new
- #===============================================================
- # ■ Scene_Fei
- #------------------------------------------------------------------------------
- # 处理传送画面的类。
- #===============================================================
- class Window_Money < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- super(320, 1, 320, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(15, 0, 640, 32, "金钱不足!", 0)
- end
- end
- class Window_No < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- super(320, 1, 320, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(15, 0, 640, 32, "等级不够,还是先练级吧。", 0)
- end
- end
- class Scene_Fei
- #include OPACITY_66RPG
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # menu_index : 命令光标的初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- #create_screen
- # 生成命令窗口
- s1 = "勇者大陆 需要等级:10 费用:1000金币"
- s2 = "仙踪林 需要等级:10 费用:1000金币"
- s3 = "冰风谷 需要等级:25 费用:1000金币"
- s4 = "村4 费用:1000金币"
- s5 = "村5 费用:2000金币"
- s6 = "村6 费用:3000金币"
- s7 = "村7 费用:3000金币"
- s8 = "村8 费用:5000金币"
- s9 = "村9 费用:5000金币"
- s10 = "村10 费用:5000金币"
- s11 = "村10 费用:5000金币"
- s12 = "村10 费用:5000金币"
- s13 = "村10 费用:5000金币"
- s14 = "村10 费用:5000金币" # 如果有更多的地图在这里添加按钮.
- @command_window = Window_Command.new(320, [s1, s2, s3, s4, s5, s6,s7,s8,s9,s10,s11,s12,s13,s14]) #对应上面
- @command_window.index = @menu_index
- @command_window.opacity = 255
- # 生成不够钱窗口
- @money_window = Window_Money.new
- @money_window.visible = false
- # 生面未探索窗口
- @no_window = Window_No.new
- @no_window.visible = false
- # 生成金钱窗口
- @gold_window = Window_Gold.new
- @gold_window.x = 320
- @gold_window.y = 415
- @gold_window.width = 320
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果切换画面就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @command_window.dispose
- @money_window.dispose
- @no_window.dispose
- @gold_window.dispose
- #dispose_screen
- end
- #--------------------------------------------------------------------------
- # ● 传送
- #--------------------------------------------------------------------------
- def Fei_item(id,money,mapid,x,y)
- @id = id
- @money = money
- @mapid = mapid
- @x = x
- @y = y
- if $game_switches[@id] == true #如果觉得开关保贵那就把这句换成 $game_variables[编号] == 数值
- if $game_party.gold > @money
- $game_system.se_play($data_system.decision_se)
- $game_party.gain_gold(-@money)
- $game_map.setup(@mapid)
- $game_player.moveto(@x,@y)
- $game_player.refresh
- $game_map.autoplay
- $game_map.update
- $scene = Scene_Map.new
- else
- $game_system.se_play($data_system.buzzer_se)
- @money_window.visible = true
- @command_window.active = false
- end
- else
- $game_system.se_play($data_system.buzzer_se)
- @no_window.visible = true
- @command_window.active = false
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @command_window.update
- @gold_window.update
- # 命令窗口被激活的情况下: 调用 update_command
- if @command_window.active
- update_command
- return
- end
- if @money_window.visible
- update_money
- return
- end
- if @no_window.visible
- update_no
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (命令窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def update_command
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换的地图画面
- $scene = Scene_Map.new
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 命令窗口的光标位置分支
- case @command_window.index
- when 0
- Fei_item(51,1000,3,22,16) #这里就是传送的函数调用 Fei_item(开关,钱,地图ID,X坐标,Y坐标)
- when 1
- Fei_item(52,1000,32,9,30)
- when 2
- Fei_item(53,1000,32,9,30)
- when 3
- Fei_item(54,1000,32,9,30)
- when 4
- Fei_item(55,1000,32,9,30)
- when 5
- Fei_item(56,1000,32,9,30)
- when 6
- Fei_item(57,1000,32,9,30)
- when 7
- Fei_item(58,1000,32,9,30)
- when 8
- Fei_item(59,1000,32,9,30)
- when 9
- Fei_item(60,1000,32,9,30)
- when 10
- Fei_item(58,1000,32,9,30)
- when 11
- Fei_item(59,1000,32,9,30)
- when 12
- Fei_item(60,1000,32,9,30)#如果上面添加多了按钮,这里也得添加. 相应复制就可以了.
- when 13
- Fei_item(60,1000,32,9,30)
- when 14
- Fei_item(60,1000,32,9,30)
- end
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update_money
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @money_window.visible = false
- @command_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.cancel_se)
- @money_window.visible = false
- @command_window.active = true
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update_no
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @no_window.visible = false
- @command_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.cancel_se)
- @no_window.visible = false
- @command_window.active = true
- return
- end
- end
- end
复制代码