设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 9982|回复: 19
打印 上一主题 下一主题

[原创发布] 蛐蛐儿的简约(渣)菜单计划 (一)

[复制链接]

Lv1.梦旅人

小小的百鬼夜行<

梦石
0
星屑
54
在线时间
579 小时
注册时间
2010-7-29
帖子
2682

贵宾

跳转到指定楼层
1
发表于 2011-8-16 12:27:26 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

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之前,并一定要放在菜单脚本的主体之前
  1. module New_Menu_Config
  2.   COMMAND = [
  3.   ["物品Item ",Scene_Item],
  4.   ["技能Skill",Scene_Skill,1],
  5.   ["装备Equip",Scene_Equip,1],
  6.   ["存档Save ",Scene_Save],
  7.   ["退出End  ",Scene_End],
  8.   ["离开Exit ",Scene_Map]]
  9. end
复制代码
- 菜单主体:初始的界面 -
  1. class Scene_Menu
  2.   include New_Menu_Config
  3.   def initialize(index=0)
  4.     @index = index
  5.     @sindex = 0
  6.   end
  7.   def main
  8.     @bitmap = Spriteset_Map.new
  9.     @back = Sprite.new
  10.     @person = []
  11.     $game_party.actors.each_index {|a|
  12.     @person[a] = RPG::Sprite.new
  13.     @person[a].bitmap = Bitmap.new(130,480)
  14.     @person[a].bitmap.blt(0,0,
  15.     Bitmap.new("Graphics/Menu/#{$game_party.actors[a].name}"),
  16.     Rect.new(0,0,640,480),150)
  17.     @person[a].bitmap.fill_rect(0,0,1,480,Color.new(255,255,255))
  18.     @person[a].bitmap.fill_rect(129,0,1,480,Color.new(255,255,255))
  19.     @person[a].x = 3 + 133*a
  20.     @person[a].bitmap.fill_rect(23, 360, 92, 3, Color.new(0,0,0))
  21.     @person[a].bitmap.fill_rect(23, 370, 92, 3, Color.new(0,0,0))
  22.     @person[a].bitmap.fill_rect(23, 380, 92, 3, Color.new(0,0,0))
  23.     @person[a].bitmap.fill_rect(24, 361,
  24.     (90*$game_party.actors[a].hp / $game_party.actors[a].maxhp).to_i, 1, Color.new(200,0,0))
  25.     @person[a].bitmap.fill_rect(24, 371,
  26.     (90*$game_party.actors[a].sp / $game_party.actors[a].maxsp).to_i, 1, Color.new(0,0,200))
  27.     @person[a].bitmap.fill_rect(24, 381,
  28.     (90*$game_party.actors[a].exp_s.to_i /
  29.     $game_party.actors[a].next_exp_s.to_i).to_i, 1, Color.new(0,200,0))
  30.     @person[a].bitmap.font.size = 11
  31.     @person[a].bitmap.blur_draw_text(10, 350, 30, 20,
  32.     "HP",1,Color.new(0,0,0,10),2)
  33.     @person[a].bitmap.blur_draw_text(40, 350, 70, 20,
  34.     "#{$game_party.actors[a].hp}/#{$game_party.actors[a].maxhp}",
  35.     1,Color.new(0,0,0,10),2)
  36.     @person[a].bitmap.blur_draw_text(10, 360, 30, 20,
  37.     "SP",1,Color.new(0,0,0,10),2)
  38.     @person[a].bitmap.blur_draw_text(40, 360, 70, 20,
  39.     "#{$game_party.actors[a].sp}/#{$game_party.actors[a].maxsp}",
  40.     1,Color.new(0,0,0,10),2)
  41.     @person[a].bitmap.blur_draw_text(10, 370, 40, 20,
  42.     "EXP",1,Color.new(0,0,0,10),2)
  43.     @person[a].bitmap.blur_draw_text(40, 370, 70, 20,
  44.     "#{$game_party.actors[a].exp_s}/#{$game_party.actors[a].next_exp_s}",
  45.     1,Color.new(0,0,0,10),2)
  46.     b = $game_party.actors[a].name.scan(/./)
  47.     b << "Lv"
  48.     b << $game_party.actors[a].level.to_s
  49.     @person[a].bitmap.font.size = 30
  50.     b.each_index {|c| @person[a].bitmap.blur_draw_text(90, 50+30*c, 30, 30,
  51.     b[c],2,Color.new(0,0,0,10),2)}}
  52.     @z = Sprite.new
  53.     @back.bitmap = Bitmap.new(640,480)
  54.     @z.bitmap = Bitmap.new(640,480)
  55.     @back.bitmap.fill_rect(0,0,640,480,Color.new(0,0,0,150))
  56.     @z.bitmap.fill_rect(0,0,640,30,Color.new(0,0,0))
  57.     @z.bitmap.fill_rect(0,450,640,30,Color.new(0,0,0))
  58.     for i in 0..255/5
  59.       @z.bitmap.fill_rect(0,30+i*3,640,3,Color.new(0,0,0,255-5*i))
  60.       @z.bitmap.fill_rect(0,450-i*3,640,3,Color.new(0,0,0,255-5*i))
  61.     end
  62.     @command = []
  63.     COMMAND.each_index {|a| @command[a] = Sprite.new
  64.     @command[a].bitmap = Bitmap.new(100,40)
  65.     @command[a].x = 640-50
  66.     @command[a].x = 540 if a == 0
  67.     @command[a].y = 50 + (a) * 42
  68.     @command[a].bitmap.font.size = 15
  69.     for i in 0...255/5
  70.       @command[a].bitmap.fill_rect(110-i*2,0,2,40,Color.new(0,0,0,255-5*i))
  71.       @command[a].bitmap.fill_rect(110-i*2,0,2,1,Color.new(255,255,255,255-5*i))
  72.       @command[a].bitmap.fill_rect(110-i*2,39,2,1,Color.new(255,255,255,255-5*i))
  73.     end
  74.     @command[a].bitmap.draw_text(0,0,100,40,COMMAND[a][0],2)}
  75.     @cout = 0
  76.     @gold = Sprite.new
  77.     @gold.x = 640-510
  78.     @gold.y = 440
  79.     @gold.bitmap = Bitmap.new(510,30)
  80.     @gold1 = Sprite.new
  81.     @gold1.x = @gold.x
  82.     @gold1.y = @gold.y
  83.     @gold1.bitmap = Bitmap.new(510,30)
  84.     for i in 0...255/5
  85.       @gold.bitmap.fill_rect(i*10,0,10,1,Color.new(255,255,255,5*i))
  86.       @gold.bitmap.fill_rect(i*10,29,10,1,Color.new(255,255,255,5*i))
  87.     end
  88.     time = Graphics.frame_count / Graphics.frame_rate
  89.     sec = time % 60
  90.     min = time / 60 % 60
  91.     hou = time / 60 / 60
  92.     @gold1.bitmap.font.size = 15
  93.     @gold1.bitmap.draw_text(0,0,510,30,"金钱  #{$game_party.gold}  " +
  94.     "   时间  #{hou}:#{min}:#{sec}",1)
  95.     Graphics.transition
  96.     change_index if @index != 0
  97.     loop {update;break if $scene != self}
  98.     @command.each {|a| a.bitmap.dispose;a.dispose}
  99.     @person.each {|a| a.bitmap.dispose;a.dispose}
  100.     @back.dispose
  101.     @z.dispose
  102.     @bitmap.dispose
  103.   end
  104.   def update
  105.     Graphics.update
  106.     update_gold
  107.     @person.each {|a| a.update} if @status
  108.     update_status and return if @status
  109.     update_input
  110.   end
  111.   def update_input
  112.     Input.update
  113.     @index += 1 and change_index if @index < COMMAND.size-1 && Input.trigger?(Input::DOWN)
  114.     @index -= 1 and change_index if @index > 0 && Input.trigger?(Input::UP)
  115.     create_class if Input.trigger?(Input::C)
  116.     $scene = Scene_Map.new if Input.trigger?(Input::B)  # 按ESC回地图
  117.     return
  118.   end
  119.   def change_index
  120.     @cin = @index
  121.     @command.each_index {|a|
  122.     @cout = a if @command[a].x != 590 && a != @index}
  123.     for i in 0...10
  124.       @command[@cin].x -= 5
  125.       @command[@cout].x += 5
  126.       Graphics.update
  127.     end
  128.   end
  129.   def update_status
  130.     Input.update
  131.     @sindex += 1 and change_sindex if @sindex < $game_party.actors.size-1 &&
  132.     Input.trigger?(Input::RIGHT)
  133.     @sindex -= 1 and change_sindex if @sindex > 0 && Input.trigger?(Input::LEFT)
  134.     $scene = COMMAND[@index][1].new(@sindex) if Input.trigger?(Input::C)
  135.     if Input.trigger?(Input::B)
  136.       @person.each {|a| a.blink_off} ; @status = false
  137.     end
  138.     return
  139.   end
  140.   def change_sindex
  141.     @person.each_index {|a| @person[a].blink_off
  142.     @person[a].blink_on if a == @sindex}
  143.   end
  144.   def create_class
  145.     $scene = COMMAND[@index][1].new and return if COMMAND[@index][2].nil?
  146.     @status = true
  147.     change_sindex
  148.   end
  149.   def update_gold
  150.     @gold1.bitmap.clear
  151.     time = Graphics.frame_count / Graphics.frame_rate
  152.     sec = time % 60
  153.     min = time / 60 % 60
  154.     hou = time / 60 / 60
  155.     @gold1.bitmap.draw_text(0,0,510,30,"金钱  #{$game_party.gold}  " +
  156.     "   时间  #{hou}:#{min}:#{sec}",1)
  157.   end
  158. end
复制代码


使用说明:
1、请在Graphics下新开文件夹Menu,并把人物立绘以人物名称命名塞到文件夹中。
2、请不要让角色的等级大于或等于最高级别。
3、这是个万年坑……
4、本脚本无版权,但外援脚本的版权还是掌握在其开发者手中。
5、在设定部分中,每个元素的一号元素是选项上的字,二号元素是选中进入的界面,如果进入的是状态、装备、技能画面,第三个元素请设置为不为nil的东西,如1,否则留空。

点评

已修正,请看主体116行。  发表于 2011-8-17 15:13
顺便说一下,在菜单界面按ESC不能回到游戏,必须点那个离开...好麻烦的。  发表于 2011-8-17 15:06

评分

参与人数 5星屑 +622 +1 收起 理由
cc610523 + 1 精品文章
DeathKing + 376 Good Job
薄荷冰水 + 14 必须全局统一才有意义啊!还是暂时用回原生.
liqunsz + 132
忧雪の伤 + 100 小小鼓励。

查看全部评分

某只PHP/HTML小白鼠→退屈の间


Cause I knew you were trouble when you walked in
So shame is on me now
I flow me to place i ve never been
till you put me down oh
Now Im lying on the cold hard ground

Lv2.观梦者

梦石
0
星屑
398
在线时间
972 小时
注册时间
2007-12-31
帖子
2137
2
发表于 2011-8-16 12:28:48 | 只看该作者
本帖最后由 liqunsz 于 2011-8-16 12:30 编辑

蛐蛐儿加了个油~❤,图片还没刷出来

图片刷出来了…………你个窗口标题三国战记立绘摸你傻……= =||||||,拿阿尔西斯也行啊喵

点评

那个黑黑的地方是要刮开看吗0. 0  发表于 2011-8-17 15:31
不是我的坑啊不是我的坑不要在意。  发表于 2011-8-16 12:35
非白字,不给力……  发表于 2011-8-16 12:33
回复 支持 反对

使用道具 举报

Lv2.观梦者

虚構歪曲

梦石
0
星屑
339
在线时间
1197 小时
注册时间
2010-12-18
帖子
3928

贵宾

3
发表于 2011-8-16 12:31:05 | 只看该作者
本帖最后由 忧雪の伤 于 2011-8-16 12:35 编辑

我只是说,为什么不用 FileTest.exist?(filename) 来判断是否存在立绘……
敢把脚本写简洁规范些么!

点评

不敢- -  发表于 2011-8-16 12:36
懒的写啊……我不如直接搬别人的系统嘛- -  发表于 2011-8-16 12:33
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1071 小时
注册时间
2011-5-12
帖子
2317

贵宾

4
发表于 2011-8-16 14:11:12 | 只看该作者
- -唔……
来学习一下~
@person.each {|a| a.update}
这句是把@person里所有资料带入a然后再update吗?
找我请找芙蕾娅
顺带一提,完全看得懂我头像请捡起你自己的节操哟(自重
回复 支持 反对

使用道具 举报

Lv2.观梦者

虚構歪曲

梦石
0
星屑
339
在线时间
1197 小时
注册时间
2010-12-18
帖子
3928

贵宾

5
发表于 2011-8-16 14:18:31 | 只看该作者
月夜神音 发表于 2011-8-16 14:11
- -唔……
来学习一下~
@person.each {|a| a.update}

把数组 @person 的每个项目迭代到 a 。

点评

了解,感谢前辈指导~  发表于 2011-8-16 14:19
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1302
在线时间
673 小时
注册时间
2009-11-11
帖子
2790
6
发表于 2011-8-17 13:09:48 | 只看该作者
怎么看着跟我那新游戏的菜单有点撞车。。。也是菜单目录在右上角。。。。。

嘿。嘿。嘿
回复 支持 反对

使用道具 举报

Lv1.梦旅人

弃坑的微博控

梦石
0
星屑
50
在线时间
548 小时
注册时间
2008-6-23
帖子
2114
7
发表于 2011-8-17 14:34:31 | 只看该作者
征用了.........还有几个选项的菜单之X有没有后文的?  

全是脚本描绘啊,貌似修改无能....
《灵中那些事》停工很久了。..

回复 支持 反对

使用道具 举报

Lv1.梦旅人

小小的百鬼夜行<

梦石
0
星屑
54
在线时间
579 小时
注册时间
2010-7-29
帖子
2682

贵宾

8
 楼主| 发表于 2011-8-17 15:14:25 | 只看该作者
本帖最后由 退屈£无聊 于 2011-8-17 15:14 编辑
薄荷冰水 发表于 2011-8-17 14:34
征用了.........还有几个选项的菜单之X有没有后文的?  

全是脚本描绘啊,貌似修改无能.... ...


总之暑假的时间也不多了……我会努力的。
不过等到全部的界面都写完也不可能只有一天两天的时间。
谢谢支持>. <
某只PHP/HTML小白鼠→退屈の间


Cause I knew you were trouble when you walked in
So shame is on me now
I flow me to place i ve never been
till you put me down oh
Now Im lying on the cold hard ground
回复 支持 反对

使用道具 举报

Lv1.梦旅人

弃坑的微博控

梦石
0
星屑
50
在线时间
548 小时
注册时间
2008-6-23
帖子
2114
9
发表于 2011-8-17 21:06:39 | 只看该作者
于是要有声音啊,声音音效啊!!!
《灵中那些事》停工很久了。..

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
543 小时
注册时间
2011-6-25
帖子
441
10
发表于 2011-8-23 14:22:04 | 只看该作者
請問....
圖片要多大

点评

謝謝  发表于 2011-8-24 09:12
无所谓.......不过人物的脸最好在左边..否则截不到  发表于 2011-8-24 08:20


------------------------------------------我只放我看中的遊戲-----------------------------------------------
臉書:http://www.facebook.com/brian.lee.52643821
  音速君的論壇
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-20 17:59

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表