赞 | 1 |
VIP | 0 |
好人卡 | 12 |
积分 | 2 |
经验 | 52910 |
最后登录 | 2024-8-20 |
在线时间 | 835 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 196
- 在线时间
- 835 小时
- 注册时间
- 2012-9-16
- 帖子
- 1811
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
废话不多说了,直接放上截图和脚本:
- =begin
- ┌─────────────────────────┐
- │ 此脚本来自小y游戏制作室,使用和转载请保留此信息。│
- └─────────────────────────┘
- ┌─────────────────────┐
- │ 此脚本来自66RPG,使用和转载请保留此信息。│
- └─────────────────────┘
- 小y脚本站:http://www.ygameSprite.com/(已失效)
- -----------------------------------------------------------------------------
- *动态阳光菜单脚本*
- by.小y
- -----------------------------------------------------------------------------
- ■ 说明
- 传统RPG十分适合使用的菜单脚本。
- ■ 功能
- 此脚本的功能:
- ☞背景滚动
- ☞选项横向
- ☞增加地名、时间、金钱窗口
- ☞“结束”选项菜单显示
- ■ 使用
- 插入脚本,在游戏Graphics\System文件夹中插入一张名称为“Menu”
- 的图片。
- -----------------------------------------------------------------------------
- =end
- class Window_PlayTime < Window_Base
- def initialize(x, y)
- super(x, y, 194 , 56)
- refresh
- end
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(8, 0, 120, 32, "时间")
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(20, 0, 120, 32, text, 2)
- end
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
- class Window_Base < Window
- def draw_actor_hp(actor, x, y, width = 60)
- draw_actor_hp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
- self.contents.font.color = system_color
- xr = x + width
- if width < 120
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.hp, 2)
- else
- self.contents.draw_text(xr - 90, y, 40, WLH, actor.hp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxhp, 2)
- end
- end
- def hp_color(actor)
- return knockout_color #if actor.hp == 0
- return crisis_color #if actor.hp < actor.maxhp / 4
- return normal_color
- end
- def mp_color(actor)
- return crisis_color #if actor.mp < actor.maxmp / 4
- return normal_color
- end
- def draw_actor_hp_gauge(actor, x, y, width = 60)
- gw = width * actor.hp / actor.maxhp
- gc1 = hp_gauge_color1
- gc2 = hp_gauge_color2
- self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- end
- def draw_actor_mp(actor, x, y, width = 60)
- draw_actor_mp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
- self.contents.font.color = system_color
- xr = x + width
- if width < 120
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.mp, 2)
- else
- self.contents.draw_text(xr - 90, y, 40, WLH, actor.mp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxmp, 2)
- end
- end
- def draw_actor_mp_gauge(actor, x, y, width = 60)
- gw = width * actor.mp / [actor.maxmp, 1].max
- gc1 = mp_gauge_color1
- gc2 = mp_gauge_color2
- self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- end
- end
- class Game_Party < Game_Unit
- MAX_MEMBERS = 2 # 最大同伴数
- end
- class Window_MenuStatus < Window_Selectable
- def initialize(x, y)
- super(x, y, 272, 226)
- refresh
- self.active = false
- self.index = -1
- end
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- for actor in $game_party.members
- draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
- x = 0#104
- y = actor.index * 96 + WLH / 2
- draw_actor_name(actor, x+100, y)
- draw_actor_class(actor, x + 190, y)
- draw_actor_level(actor, x+180, y + WLH * 2)
- draw_actor_state(actor, x, y + WLH * 3 - 12)
- draw_actor_hp(actor, x + 100, y + WLH * 1)
- draw_actor_mp(actor, x + 100, y + WLH * 2)
- end
- end
- end
- class Window_Gold1 < Window_Base
- def initialize(x, y)
- super(x, y, 150, WLH + 32)
- refresh
- end
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(-2, -4, 120, 32, "金钱")
- draw_currency_value($game_party.gold, -1, 0, 120)
- end
- end
- class Scene_Menu < Scene_Base
- def start
- super
- create_menu_background
- create_command_window
- @menucommandviewport = Viewport.new(0, 0, 544, 416)
- @menucommandplane = Plane.new(@menucommandviewport4)
- @menucommandplane.bitmap = Cache.system("Menu")
- #~ @menu_bg = Sprite.new
- #~ @menu_bg.bitmap = Cache.system("Menu")
- @gold_window = Window_Gold1.new(0, 360)
- @status_window = Window_MenuStatus.new(136, 95)
- @now_place_window = Window_Base.new(150, 360, 200, 56)
- @time_window = Window_PlayTime.new(350,360)
- @now_place_window.contents.font.color = @now_place_window.text_color(3)
- map_name = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name
- @now_place_window.contents.draw_text(3, 0, 120, 24, "位置")
- @now_place_window.contents.draw_text(70, 0, 120, 24, map_name)
- @now_place_window.z = 1
- create_command2_window
- @command2_window.active = false
- @command2_window.visible = false
- end
- def terminate
- super
- dispose_menu_background
- @command_window.dispose
- @menucommandplane.dispose
- @menucommandviewport.dispose
- @command2_window.dispose
- @gold_window.dispose
- @time_window.dispose
- #~ @menu_bg.dispose
- @now_place_window.dispose
- @status_window.dispose
- end
- def update
- super
- update_menu_background
- @menucommandplane.ox += 4 if Graphics.frame_count % 2 == 0
- @command_window.update
- @command2_window.update
- @gold_window.update
- @time_window.update
- #~ @menu_bg.update
- @now_place_window.update
- @status_window.update
- if @command_window.active
- update_command_selection
- elsif @command2_window.active
- update_command2_selection
- elsif @status_window.active
- update_actor_selection
- end
- end
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = Vocab::status
- s5 = Vocab::save
- s6 = "结束"
- @command_window = Window_Command.new(544, [s1, s2, s3, s4, s5, s6], 6)
- @command_window.index = @menu_index
- if $game_party.members.size == 0 # 同伴人数为 0 的情况下
- @command_window.draw_item(0, false) # 物品无效化
- @command_window.draw_item(1, false) # 特技无效化
- @command_window.draw_item(2, false) # 装备无效化
- @command_window.draw_item(3, false) # 状态无效化
- end
- if $game_system.save_disabled # 禁止存档的情况下
- @command_window.draw_item(4, false) # 存档无效化
- end
- end
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0 # 物品
- $scene = Scene_Item.new
- when 1,2,3 # 特技、装备、状态
- start_actor_selection
- when 4 # 存档
- $scene = Scene_File.new(true, false, false)
- when 5 # 游戏结束
- @command2_window.active = true
- @command2_window.visible = true
- @command_window.active = false
- end
- end
- end
- def create_command2_window
- s1 = "标题"
- s2 = "退出"
- s3 = "取消"
- @command2_window = Window_Command.new(152, [s1, s2, s3])
- @command2_window.index = 0
- @command2_window.x = 272 - 62
- @command2_window.y = 208 - 55
- @command2_window.opacity = 225
- end
- def start_actor_selection
- @command_window.active = false
- @status_window.active = true
- if $game_party.last_actor_index < @status_window.item_max
- @status_window.index = $game_party.last_actor_index
- else
- @status_window.index = 0
- end
- end
- def end_actor_selection
- @command_window.active = true
- @status_window.active = false
- @status_window.index = -1
- end
- def update_actor_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_actor_selection
- elsif Input.trigger?(Input::C)
- $game_party.last_actor_index = @status_window.index
- Sound.play_decision
- case @command_window.index
- when 1 # スキル
- $scene = Scene_Skill.new(@status_window.index)
- when 2 # 装備
- $scene = Scene_Equip.new(@status_window.index)
- when 3 # ステータス
- $scene = Scene_Status.new(@status_window.index)
- end
- end
- end
- def update_command2_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @command2_window.active = false
- @command2_window.visible = false
- @command_window.active = true
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- case @command2_window.index
- when 0 # スキル
- Sound.play_decision
- RPG::BGM.fade(800)
- RPG::BGS.fade(800)
- RPG::ME.fade(800)
- $scene = Scene_Title.new
- Graphics.fadeout(60)
- when 1 # 装備
- Sound.play_decision
- RPG::BGM.fade(800)
- RPG::BGS.fade(800)
- RPG::ME.fade(800)
- $scene = nil
- when 2 # ステータス
- Sound.play_decision
- @command2_window.active = false
- @command2_window.visible = false
- @command_window.active = true
- end
- end
- end
- end
复制代码 |
|