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

Project1

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

[已经解决] 请问这种菜单怎么才能做出来?为什么会在右边?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
3 小时
注册时间
2014-7-31
帖子
12
跳转到指定楼层
1
发表于 2014-8-3 09:26:59 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
还有那种透明的感觉是用脚本还是窗口图片?

QQ截图20130113193043.png (241.31 KB, 下载次数: 30)

QQ截图20130113193043.png

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2014-8-3 09:31:18 | 只看该作者
窗口图片。但是除了半透明以外的效果要用到脚本
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
98
在线时间
1617 小时
注册时间
2013-8-15
帖子
4459
3
发表于 2014-8-3 12:37:04 | 只看该作者
本帖最后由 永燃的狂炎 于 2014-8-3 13:16 编辑

顺路,求楼主 放出菜单的字体  
召唤严厉的版主 @VIPArcher
为了我的10经验 所谓经验能使鬼推磨...
那我就给你相似的脚本,只是改图片就行了
RUBY 代码复制
  1. class Scene_MenuBase < Scene_Base
  2.   #----------------------------------------------------------------------------
  3.   # * 初始化
  4.   #----------------------------------------------------------------------------
  5.   def initialize
  6.     super
  7.     @last_index = 0 if @last_index == nil
  8.   end
  9. end
  10. class Window_MenuCommand < Window_Command
  11.   #----------------------------------------------------------------------------
  12.   # * 重命名方法
  13.   #----------------------------------------------------------------------------
  14.   alias nir item_rect
  15.   #----------------------------------------------------------------------------
  16.   # * 初始化
  17.   #----------------------------------------------------------------------------
  18.   def initialize
  19.     @command_icon_index = [260, 96, 170, 16, 280, 375, 12]
  20.     super(0, 0)
  21.   end
  22.   #----------------------------------------------------------------------------
  23.   # * 描绘选项
  24.   #----------------------------------------------------------------------------
  25.   def draw_item(index)
  26.     rect = item_rect_for_text(index)
  27.     draw_icon(@command_icon_index[index], rect.x, rect.y, command_enabled?(index))
  28.     self.contents.font.color.alpha = (command_enabled?(index) ? 255 : 160)
  29.     self.contents.draw_text(rect.x + 24, rect.y, rect.width - 24, rect.height, command_name(index))
  30.   end
  31.   #----------------------------------------------------------------------------
  32.   # * 获取项目的描绘矩形
  33.   #----------------------------------------------------------------------------
  34.   def item_rect(index)
  35.     return Rect.new
  36.   end
  37.   #----------------------------------------------------------------------------
  38.   # * 获取项目的绘制矩形(内容用)
  39.   #----------------------------------------------------------------------------
  40.   def item_rect_for_text(index)
  41.     rect = nir(index)
  42.     rect.x += 4
  43.     rect.width -= 8
  44.     rect
  45.   end
  46. end
  47. class Window_NewMenuStatus < Window_Command
  48.   #----------------------------------------------------------------------------
  49.   # * 初始化
  50.   #----------------------------------------------------------------------------
  51.   def initialize
  52.     super(160, 0)
  53.   end
  54.   #----------------------------------------------------------------------------
  55.   # * 获取窗口的宽度
  56.   #----------------------------------------------------------------------------
  57.   def window_width
  58.     return 384
  59.   end
  60.   #----------------------------------------------------------------------------
  61.   # * 获取窗口的高度
  62.   #----------------------------------------------------------------------------
  63.   def window_height
  64.     return 416
  65.   end
  66.   #----------------------------------------------------------------------------
  67.   # * 更新内容
  68.   #----------------------------------------------------------------------------
  69.   def refresh
  70.     super
  71.     draw_actor_status
  72.   end
  73.   #----------------------------------------------------------------------------
  74.   # * 生成指令列表
  75.   #----------------------------------------------------------------------------
  76.   def make_command_list
  77.     for actor in $game_party.members
  78.       s = "a[#{actor.id}]"
  79.       add_command(actor.name, s.to_sym, !actor.death_state?, actor.id)
  80.     end
  81.   end
  82.   #----------------------------------------------------------------------------
  83.   # * 描绘选项
  84.   #----------------------------------------------------------------------------
  85.   def draw_item(index)
  86.     rect = item_rect_for_text(index)
  87.     b = Bitmap.new(rect.width, rect.height)
  88.     cn = $game_actors[@list[index][:ext]].character_name
  89.     ci = $game_actors[@list[index][:ext]].character_index
  90.     cb = Cache.character(cn)
  91.     if cn[0] == "[        DISCUZ_CODE_2547        ]quot"
  92.       cr = Rect.new
  93.       cr.x = cb.width / 3
  94.       cr.width = cb.width / 3
  95.       cr.height = cb.height / 4
  96.     else
  97.       cr = Rect.new
  98.       cr.x = ci % 4 * (cb.width / 4) + cb.width / 12
  99.       cr.y = ci / 4 * (cb.height / 2)
  100.       cr.width = cb.width / 12
  101.       cr.height = cb.height / 8
  102.     end
  103.     b.blt((b.width - cr.width) / 2, (b.height - cr.height) / 2, cb, cr)
  104.     unless command_enabled?(index)
  105.       for y in 0...b.height
  106.         for x in 0...b.width
  107.           next if b.get_pixel(x, y).alpha == 0
  108.           c = b.get_pixel(x, y)
  109.           m = (c.red + c.green + c.blue) / 3
  110.           b.set_pixel(x, y, Color.new(m, m, m, c.alpha))
  111.         end
  112.       end
  113.     end
  114.     self.contents.blt(rect.x, rect.y, b, b.rect)
  115.     b.dispose
  116.     cb.dispose
  117.   end
  118.   #----------------------------------------------------------------------------
  119.   # * 获取项目的绘制矩形
  120.   #----------------------------------------------------------------------------
  121.   def item_rect(index)
  122.     rect = Rect.new
  123.     rect.width = self.contents.width / 4
  124.     rect.height = 48
  125.     rect.x = (index < 4 ? index * rect.width : (index - 4) * rect.width)
  126.     rect.y = (index < 4 ? 0 : self.contents.height - rect.height)
  127.     return rect
  128.   end
  129.   #----------------------------------------------------------------------------
  130.   # * 描绘角色的状态
  131.   #----------------------------------------------------------------------------
  132.   def draw_actor_status
  133.     actor = $game_actors[@list[@index][:ext]]
  134.     y = item_rect_for_text(0).height + 5
  135.     h = self.contents.height - 2 * (item_rect_for_text(0).height + 5)
  136.     self.contents.clear_rect(Rect.new(0, y, self.contents.width, h))
  137.     draw_actor_face(actor, 0, y)
  138.     draw_actor_name(actor, 0, y)
  139.     draw_actor_level(actor, 96, y)
  140.     draw_actor_nickname(actor, 168, y)
  141.     draw_actor_hp(actor, 96, y + line_height, self.contents.width - 96)
  142.     draw_actor_mp(actor, 96, y + 2 * line_height, self.contents.width - 96)
  143.     draw_actor_icons(actor, 96, y + 3 * line_height)
  144.     for i in 0...6
  145.       draw_actor_param(actor, 0, y + (4 + i) * line_height, i)
  146.     end
  147.     for i in 0...5
  148.       draw_item_name(actor.equips[i], self.contents.width / 2, y + (4 + i) * line_height) if actor.equips[i] != nil
  149.     end
  150.   end
  151.   #----------------------------------------------------------------------------
  152.   # * 选择项目
  153.   #----------------------------------------------------------------------------
  154.   def select(index)
  155.     super
  156.     draw_actor_status
  157.   end
  158. end
  159. class Window_NewGold < Window_Base
  160.   #----------------------------------------------------------------------------
  161.   # * 初始化
  162.   #----------------------------------------------------------------------------
  163.   def initialize
  164.     super(0, 368, 160, 48)
  165.     refresh
  166.   end
  167.   #----------------------------------------------------------------------------
  168.   # * 描绘内容
  169.   #----------------------------------------------------------------------------
  170.   def refresh
  171.     draw_icon(262, 0, 0)
  172.     draw_currency_value($game_party.gold, Vocab::currency_unit, 28, 0, self.contents.width-32)
  173.   end
  174. end
  175. class Scene_Menu < Scene_MenuBase
  176.   #----------------------------------------------------------------------------
  177.   # * 初始化
  178.   #----------------------------------------------------------------------------
  179.   def initialize
  180.     super
  181.     @select_actor = []
  182.   end
  183.   #----------------------------------------------------------------------------
  184.   # * 开始处理
  185.   #----------------------------------------------------------------------------
  186.   def start
  187.     super
  188.     create_frame_sprite
  189.     create_menu_window
  190.     create_menustatus_command
  191.     create_gold_window
  192.     create_select_sprite
  193.   end
  194.   #----------------------------------------------------------------------------
  195.   # * 更新画面
  196.   #----------------------------------------------------------------------------
  197.   def update
  198.     super
  199.     @select_sprite.y = 12 + @menu_command.index * 24 + (@select_sprite.bitmap.height - 24) / 2
  200.     @frame_sprite.update
  201.     @select_sprite.update
  202.   end
  203.   #----------------------------------------------------------------------------
  204.   # * 释放画面
  205.   #----------------------------------------------------------------------------
  206.   def terminate
  207.     super
  208.     @frame_sprite.dispose
  209.     @select_sprite.dispose
  210.   end
  211.   #----------------------------------------------------------------------------
  212.   # * 创建边框精灵
  213.   #----------------------------------------------------------------------------
  214.   def create_frame_sprite
  215.     @frame_sprite = Sprite.new
  216.     @frame_sprite.bitmap = Cache.system("素材1")
  217.   end
  218.   #----------------------------------------------------------------------------
  219.   # * 创建选择精灵
  220.   #----------------------------------------------------------------------------
  221.   def create_select_sprite
  222.     @select_sprite = Sprite.new
  223.     @select_sprite.bitmap = Cache.system("素材2")
  224.     @select_sprite.x = 148
  225.     @select_sprite.y = 12 + @menu_command.index * 24 + (@select_sprite.bitmap.height - 24) / 2
  226.   end
  227.   #----------------------------------------------------------------------------
  228.   # * 创建菜单选项
  229.   #----------------------------------------------------------------------------
  230.   def create_menu_window
  231.     @menu_command = Window_MenuCommand.new
  232.     @menu_command.set_handler(:item,      method(:item_ok))
  233.     @menu_command.set_handler(:skill,     method(:command_personal))
  234.     @menu_command.set_handler(:equip,     method(:command_personal))
  235.     @menu_command.set_handler(:status,    method(:command_personal))
  236.     @menu_command.set_handler(:formation, method(:command_personal))
  237.     @menu_command.set_handler(:save,      method(:save_ok))
  238.     @menu_command.set_handler(:game_end,  method(:game_end_ok))
  239.     @menu_command.set_handler(:cancel,    method(:return_scene))
  240.     @menu_command.select(@last_index)
  241.     @menu_command.opacity = 0
  242.   end
  243.   #----------------------------------------------------------------------------
  244.   # * 创建人物状态选单
  245.   #----------------------------------------------------------------------------
  246.   def create_menustatus_command
  247.     @menustatus_command = Window_NewMenuStatus.new
  248.     @menustatus_command.set_handler(:ok    , method(:status_ok))
  249.     @menustatus_command.set_handler(:cancel, method(:status_cancel))
  250.     @menustatus_command.active = false
  251.     @menustatus_command.opacity = 0
  252.   end
  253.   #----------------------------------------------------------------------------
  254.   # * 创建金钱窗口
  255.   #----------------------------------------------------------------------------
  256.   def create_gold_window
  257.     @gold_window = Window_NewGold.new
  258.     @gold_window.opacity = 0
  259.   end
  260.   #----------------------------------------------------------------------------
  261.   # * "物品"选项确定
  262.   #----------------------------------------------------------------------------
  263.   def item_ok
  264.     SceneManager.call(Scene_Item)
  265.     @last_index = @menu_command.index
  266.   end
  267.   #----------------------------------------------------------------------------
  268.   # * "技能""装备""状态""整队"选项确定
  269.   #----------------------------------------------------------------------------
  270.   def command_personal
  271.     @menu_command.active = false
  272.     @menustatus_command.active = true
  273.     @last_index = @menu_command.index
  274.   end
  275.   #----------------------------------------------------------------------------
  276.   # * "存档"选项确定
  277.   #----------------------------------------------------------------------------
  278.   def save_ok
  279.     SceneManager.call(Scene_Save)
  280.     @last_index = @menu_command.index
  281.   end
  282.   #----------------------------------------------------------------------------
  283.   # * "结束游戏"选项确定
  284.   #----------------------------------------------------------------------------
  285.   def game_end_ok
  286.     SceneManager.call(Scene_End)
  287.     @last_index = @menu_command.index
  288.   end
  289.   #----------------------------------------------------------------------------
  290.   # * 状态窗口确定
  291.   #----------------------------------------------------------------------------
  292.   def status_ok
  293.     $game_party.menu_actor = $game_actors[@menustatus_command.current_ext]
  294.     case @menu_command.current_symbol
  295.     when :skill
  296.       SceneManager.call(Scene_Skill)
  297.     when :equip
  298.       SceneManager.call(Scene_Equip)
  299.     when :status
  300.       SceneManager.call(Scene_Status)
  301.     when :formation
  302.       case @select_actor.size
  303.       when 0
  304.         @select_actor[0] = @menustatus_command.index
  305.         @menustatus_command.active = true
  306.       when 1
  307.         @select_actor[1] = @menustatus_command.index
  308.         $game_party.swap_order(@select_actor[0], @select_actor[1])
  309.         @select_actor = []
  310.         @menustatus_command.refresh
  311.         @menu_command.active = true
  312.       end
  313.     end
  314.   end
  315.   #----------------------------------------------------------------------------
  316.   # * 状态窗口取消
  317.   #----------------------------------------------------------------------------
  318.   def status_cancel
  319.     @menu_command.active = true
  320.     @menustatus_command.active = false
  321.   end
  322. end




素材保存Graphics>System 就行了

评分

参与人数 2星屑 +66 梦石 +1 收起 理由
taroxd + 1 ...
VIPArcher + 66 ...

查看全部评分

神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-20 17:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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