赞 | 3 |
VIP | 32 |
好人卡 | 0 |
积分 | 1 |
经验 | 14756 |
最后登录 | 2021-5-30 |
在线时间 | 579 小时 |
Lv1.梦旅人 小小的百鬼夜行<
- 梦石
- 0
- 星屑
- 54
- 在线时间
- 579 小时
- 注册时间
- 2010-7-29
- 帖子
- 2682
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 退屈£无聊 于 2011-8-17 15:12 编辑
菜单计划之二:http://rpg.blue/thread-202724-1-1.html
前言:
由于最近不想填坑,所以挖了个菜单坑(....
喵,总之没有PS过,效果很渣,触手及高要求者请点右上角。
目前只做了菜单的开始界面= =(啥叫开始
外援脚本:
-必用- 描绘字符扩张 By忧雪の伤 http://rpg.blue/thread-181553-1-1.html
介绍:用来让描绘字符得到比较好的效果。
-备用- 容错脚本 By轮回者 http://rpg.blue/thread-44200-1-1.html
介绍:如果你没有人物立绘的话,请使用这个脚本规避。
效果:
脚本内容:
- 设定部分 -(请放在MAIN之前,并一定要放在菜单脚本的主体之前- module New_Menu_Config
- COMMAND = [
- ["物品Item ",Scene_Item],
- ["技能Skill",Scene_Skill,1],
- ["装备Equip",Scene_Equip,1],
- ["存档Save ",Scene_Save],
- ["退出End ",Scene_End],
- ["离开Exit ",Scene_Map]]
- end
复制代码 - 菜单主体:初始的界面 -- class Scene_Menu
- include New_Menu_Config
- def initialize(index=0)
- @index = index
- @sindex = 0
- end
- def main
- @bitmap = Spriteset_Map.new
- @back = Sprite.new
- @person = []
- $game_party.actors.each_index {|a|
- @person[a] = RPG::Sprite.new
- @person[a].bitmap = Bitmap.new(130,480)
- @person[a].bitmap.blt(0,0,
- Bitmap.new("Graphics/Menu/#{$game_party.actors[a].name}"),
- Rect.new(0,0,640,480),150)
- @person[a].bitmap.fill_rect(0,0,1,480,Color.new(255,255,255))
- @person[a].bitmap.fill_rect(129,0,1,480,Color.new(255,255,255))
- @person[a].x = 3 + 133*a
- @person[a].bitmap.fill_rect(23, 360, 92, 3, Color.new(0,0,0))
- @person[a].bitmap.fill_rect(23, 370, 92, 3, Color.new(0,0,0))
- @person[a].bitmap.fill_rect(23, 380, 92, 3, Color.new(0,0,0))
- @person[a].bitmap.fill_rect(24, 361,
- (90*$game_party.actors[a].hp / $game_party.actors[a].maxhp).to_i, 1, Color.new(200,0,0))
- @person[a].bitmap.fill_rect(24, 371,
- (90*$game_party.actors[a].sp / $game_party.actors[a].maxsp).to_i, 1, Color.new(0,0,200))
- @person[a].bitmap.fill_rect(24, 381,
- (90*$game_party.actors[a].exp_s.to_i /
- $game_party.actors[a].next_exp_s.to_i).to_i, 1, Color.new(0,200,0))
- @person[a].bitmap.font.size = 11
- @person[a].bitmap.blur_draw_text(10, 350, 30, 20,
- "HP",1,Color.new(0,0,0,10),2)
- @person[a].bitmap.blur_draw_text(40, 350, 70, 20,
- "#{$game_party.actors[a].hp}/#{$game_party.actors[a].maxhp}",
- 1,Color.new(0,0,0,10),2)
- @person[a].bitmap.blur_draw_text(10, 360, 30, 20,
- "SP",1,Color.new(0,0,0,10),2)
- @person[a].bitmap.blur_draw_text(40, 360, 70, 20,
- "#{$game_party.actors[a].sp}/#{$game_party.actors[a].maxsp}",
- 1,Color.new(0,0,0,10),2)
- @person[a].bitmap.blur_draw_text(10, 370, 40, 20,
- "EXP",1,Color.new(0,0,0,10),2)
- @person[a].bitmap.blur_draw_text(40, 370, 70, 20,
- "#{$game_party.actors[a].exp_s}/#{$game_party.actors[a].next_exp_s}",
- 1,Color.new(0,0,0,10),2)
- b = $game_party.actors[a].name.scan(/./)
- b << "Lv"
- b << $game_party.actors[a].level.to_s
- @person[a].bitmap.font.size = 30
- b.each_index {|c| @person[a].bitmap.blur_draw_text(90, 50+30*c, 30, 30,
- b[c],2,Color.new(0,0,0,10),2)}}
- @z = Sprite.new
- @back.bitmap = Bitmap.new(640,480)
- @z.bitmap = Bitmap.new(640,480)
- @back.bitmap.fill_rect(0,0,640,480,Color.new(0,0,0,150))
- @z.bitmap.fill_rect(0,0,640,30,Color.new(0,0,0))
- @z.bitmap.fill_rect(0,450,640,30,Color.new(0,0,0))
- for i in 0..255/5
- @z.bitmap.fill_rect(0,30+i*3,640,3,Color.new(0,0,0,255-5*i))
- @z.bitmap.fill_rect(0,450-i*3,640,3,Color.new(0,0,0,255-5*i))
- end
- @command = []
- COMMAND.each_index {|a| @command[a] = Sprite.new
- @command[a].bitmap = Bitmap.new(100,40)
- @command[a].x = 640-50
- @command[a].x = 540 if a == 0
- @command[a].y = 50 + (a) * 42
- @command[a].bitmap.font.size = 15
- for i in 0...255/5
- @command[a].bitmap.fill_rect(110-i*2,0,2,40,Color.new(0,0,0,255-5*i))
- @command[a].bitmap.fill_rect(110-i*2,0,2,1,Color.new(255,255,255,255-5*i))
- @command[a].bitmap.fill_rect(110-i*2,39,2,1,Color.new(255,255,255,255-5*i))
- end
- @command[a].bitmap.draw_text(0,0,100,40,COMMAND[a][0],2)}
- @cout = 0
- @gold = Sprite.new
- @gold.x = 640-510
- @gold.y = 440
- @gold.bitmap = Bitmap.new(510,30)
- @gold1 = Sprite.new
- @gold1.x = @gold.x
- @gold1.y = @gold.y
- @gold1.bitmap = Bitmap.new(510,30)
- for i in 0...255/5
- @gold.bitmap.fill_rect(i*10,0,10,1,Color.new(255,255,255,5*i))
- @gold.bitmap.fill_rect(i*10,29,10,1,Color.new(255,255,255,5*i))
- end
- time = Graphics.frame_count / Graphics.frame_rate
- sec = time % 60
- min = time / 60 % 60
- hou = time / 60 / 60
- @gold1.bitmap.font.size = 15
- @gold1.bitmap.draw_text(0,0,510,30,"金钱 #{$game_party.gold} " +
- " 时间 #{hou}:#{min}:#{sec}",1)
- Graphics.transition
- change_index if @index != 0
- loop {update;break if $scene != self}
- @command.each {|a| a.bitmap.dispose;a.dispose}
- @person.each {|a| a.bitmap.dispose;a.dispose}
- @back.dispose
- @z.dispose
- @bitmap.dispose
- end
- def update
- Graphics.update
- update_gold
- @person.each {|a| a.update} if @status
- update_status and return if @status
- update_input
- end
- def update_input
- Input.update
- @index += 1 and change_index if @index < COMMAND.size-1 && Input.trigger?(Input::DOWN)
- @index -= 1 and change_index if @index > 0 && Input.trigger?(Input::UP)
- create_class if Input.trigger?(Input::C)
- $scene = Scene_Map.new if Input.trigger?(Input::B) # 按ESC回地图
- return
- end
- def change_index
- @cin = @index
- @command.each_index {|a|
- @cout = a if @command[a].x != 590 && a != @index}
- for i in 0...10
- @command[@cin].x -= 5
- @command[@cout].x += 5
- Graphics.update
- end
- end
- def update_status
- Input.update
- @sindex += 1 and change_sindex if @sindex < $game_party.actors.size-1 &&
- Input.trigger?(Input::RIGHT)
- @sindex -= 1 and change_sindex if @sindex > 0 && Input.trigger?(Input::LEFT)
- $scene = COMMAND[@index][1].new(@sindex) if Input.trigger?(Input::C)
- if Input.trigger?(Input::B)
- @person.each {|a| a.blink_off} ; @status = false
- end
- return
- end
- def change_sindex
- @person.each_index {|a| @person[a].blink_off
- @person[a].blink_on if a == @sindex}
- end
- def create_class
- $scene = COMMAND[@index][1].new and return if COMMAND[@index][2].nil?
- @status = true
- change_sindex
- end
- def update_gold
- @gold1.bitmap.clear
- time = Graphics.frame_count / Graphics.frame_rate
- sec = time % 60
- min = time / 60 % 60
- hou = time / 60 / 60
- @gold1.bitmap.draw_text(0,0,510,30,"金钱 #{$game_party.gold} " +
- " 时间 #{hou}:#{min}:#{sec}",1)
- end
- end
复制代码
使用说明:
1、请在Graphics下新开文件夹Menu,并把人物立绘以人物名称命名塞到文件夹中。
2、请不要让角色的等级大于或等于最高级别。
3、这是个万年坑……
4、本脚本无版权,但外援脚本的版权还是掌握在其开发者手中。
5、在设定部分中,每个元素的一号元素是选项上的字,二号元素是选中进入的界面,如果进入的是状态、装备、技能画面,第三个元素请设置为不为nil的东西,如1,否则留空。 |
评分
-
查看全部评分
|