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

Project1

 找回密码
 注册会员
搜索

如何把菜单整个改掉

查看数: 1924 | 评论数: 5 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2015-8-9 14:01

正文摘要:

本鑫想实现这样的效果,就是一按B键就直接出现如下的菜单 左边是主人物的状态 右边是主人物的技能 光标在右边 可以上下移动 按确定键是就会生成一个技能介绍的窗口 要怎么写? ...

回复

tseyik 发表于 2015-8-10 13:44:46
本帖最后由 tseyik 于 2015-8-10 13:46 编辑

最簡単就是禁止調用菜単
自己用事件寫一個
按B就直接調用該事件

或者用選單編輯器做一個
https://rpg.blue/thread-378309-1-1.html
浮云半仙 发表于 2015-8-10 13:27:41


{:2_264:} 就是弄个合适的位置竟然弄了那么久

脚本:
#encoding:utf-8

class Window_MenuSkillList < Window_Selectable
  attr_reader :skills
  def initialize
    super(400,0,144,416)
    make_skill_list
    open
    select(0)
    activate
  end
  def make_skill_list
    @skills = $game_party.members[0].skills
    idx = 0
    @skills.each do |each_skill|
      draw_item(idx,each_skill.name)
      #msgbox(each_skill.name)
      idx += 1
    end
  end
  def draw_item(index,text)
    draw_text(item_rect_for_text(index), text)
  end
  def item_max
    return @skills? @skills.size : 1
  end
end

class Window_Status_SpecialChg < Window_Status
  def initialize(actor)
    super(actor)
  end
  def draw_block1(y)
    draw_actor_name(@actor, 4, y)
    draw_actor_class(@actor, 80, y)
    draw_actor_nickname(@actor, 128, y)
  end
  def draw_block2(y)
    draw_actor_face(@actor, 8, y)
    draw_basic_info(126, y)
    draw_exp_info(218, y)
  end
  def draw_block3(y)
    draw_parameters(32, y)
    draw_equipments(144, y)
  end
  def draw_actor_param(actor, x, y, param_id)
    change_color(system_color)
    draw_text(x, y, 120, line_height, Vocab::param(param_id))
    change_color(normal_color)
    draw_text(x + 40, y, 36, line_height, actor.param(param_id), 2)
  end
  def draw_exp_info(x, y)
    s1 = @actor.max_level? ? "-" : @actor.exp
    s2 = @actor.max_level? ? "-" : @actor.next_level_exp - @actor.exp
    s_next = sprintf(Vocab::ExpNext, Vocab::level)
    change_color(system_color)
    draw_text(x-40, y + line_height * 0, 100, line_height, Vocab::ExpTotal)
    draw_text(x-40, y + line_height * 1, 100, line_height, s_next)
    change_color(normal_color)
    draw_text(x+60, y + line_height * 0, 60, line_height, s1, 2)
    draw_text(x+60, y + line_height * 1, 60, line_height, s2, 2)
  end
end

class Window_MenuSkillHelp < Window_Help
  def initialize
    super(3)
    close
  end
end

class Scene_Menu < Scene_Base
  def start
    super
    create_status_window
    create_skill_list
  end
  def create_status_window
    @status_window = Window_Status_SpecialChg.new($game_party.members[0])
    @status_window.x = 0
    @status_window.y = 0
    @status_window.height = Graphics.height
    @status_window.width = 360
  end
  def create_skill_list
    @skill_list = Window_MenuSkillList.new
    @skill_list.height = @status_window.height
    @skill_list.width = Graphics.width - @status_window.width
    @skill_list.x = @status_window.width
    @skill_list.y = 0
    #@skill_list.set_handler(:cancel,method(:skill_list_cancel))
                 #这个不好用啦,直接重载update(好bao力 O(∩_∩))
    @skill_list.set_handler(:ok,    method(:skill_list_ok))
  end
  def skill_list_ok
    @help ||= Window_MenuSkillHelp.new
    @help.set_text(@skill_list.skills[@skill_list.index].description)
    @help.open
  end
  def update
    super
    if Input.trigger?(:B)
      if @help != nil && @help.open?
        @help.close
        @skill_list.activate
      else
        SceneManager.return
      end
    end
  end
end

点评

非常感谢,辛苦你了...  发表于 2015-8-10 14:15
浮云半仙 发表于 2015-8-10 12:52:51
浮云半仙 发表于 2015-8-10 12:44
这样么?

脚本:

orz....那个箭头我也不知道怎么去掉,
{:2_253:}我刚发现,左边状态窗口里面有些东西显示不全{:2_275:}我再改下
浮云半仙 发表于 2015-8-10 12:44:26


这样么?

脚本:


#记得把原先va自带的Scene_Menu删掉,这个脚本才能正确运行
#encoding:utf-8

class Window_MenuSkillList < Window_Selectable
  attr_reader :skills
  def initialize
    super(400,0,144,416)
    make_skill_list
    open
    select(0)
    activate
  end
  def make_skill_list
    @skills = $game_party.members[0].skills
    idx = 0
    @skills.each do |each_skill|
      draw_item(idx,each_skill.name)
      #msgbox(each_skill.name)
      idx += 1
    end
  end
  def draw_item(index,text)
    draw_text(item_rect_for_text(index), text)
  end
  def item_max
    return @skills? @skills.size : 1
  end
end

class Window_MenuSkillHelp < Window_Help
  def initialize
    super(3)
    close
  end
end

class Scene_Menu < Scene_Base
  def start
    super
    create_status_window
    create_skill_list
  end
  def create_status_window
    @status_window = Window_Status.new($game_party.members[0])
    @status_window.x = 0
    @status_window.y = 0
    @status_window.height = Graphics.height
    @status_window.width = 360
  end
  def create_skill_list
    @skill_list = Window_MenuSkillList.new
    @skill_list.height = @status_window.height
    @skill_list.width = Graphics.width - @status_window.width
    @skill_list.x = @status_window.width
    @skill_list.y = 0
    #@skill_list.set_handler(:cancel,method(:skill_list_cancel))
                 #这个不好用啦,直接重载update(好bao力 O(∩_∩))
    @skill_list.set_handler(:ok,    method(:skill_list_ok))
  end
  def skill_list_ok
    @help ||= Window_MenuSkillHelp.new
    @help.set_text(@skill_list.skills[@skill_list.index].description)
    @help.open
  end
  def update
    super
    if Input.trigger?(:B)
      if @help != nil && @help.open?
        @help.close
        @skill_list.activate
      else
        SceneManager.return
      end
    end
  end
end

点评

你介不介意去掉显示人物说明或者人物经验?要不真的是画不下、、、、、  发表于 2015-8-10 13:03
嗯,就是这样,非常感谢!话说怎么吧那个右剪头去掉?  发表于 2015-8-10 12:50

评分

参与人数 2星屑 +30 梦石 +1 收起 理由
鑫の尘埃 + 30 认可答案
taroxd + 1 认可答案

查看全部评分

浮云半仙 发表于 2015-8-10 11:58:29

你是要这样的么?

点评

左边本鑫想换成状态窗口,就是有具体数据和装备、介绍的那个框  发表于 2015-8-10 12:14
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2025-7-22 08:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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