查看: 2341|回复: 3

[已经解决] 关于菜单修改

[复制链接]
梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-10-7
回帖
19
发表于 2015-1-4 21:32:11 | 显示全部楼层 |阅读模式

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

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

×
想把菜单界面改成像图片那样

已经知道物品那该怎样修改位置 但其他的不会更改

不知道该改哪个脚本才对呢><
圖片 7.jpg

无限の剣制

梦石
0
星屑
10450
在线时间
5019 小时
注册时间
2013-2-28
回帖
4942

开拓者贵宾

发表于 2015-1-4 22:15:22 | 显示全部楼层
本帖最后由 VIPArcher 于 2015-1-5 23:11 编辑

那个条是可以改变颜色的。可以修改Window_Base#draw_actor_hp方法。例如:
[pre lang="ruby" line="1"]class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 绘制 HP
  #--------------------------------------------------------------------------
  #修改这个句脚本里的 hp_gauge_color1, hp_gauge_color2 两个参数,Color类
  #例如
  def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate,Color.new(0,200,0),Color.new(100,0,0))
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    change_color(normal_color)
    draw_text(x, y, width,line_height, actor.hp.to_s , 2)
  end
#~   原方法对照一下你自己看看吧
#~   def draw_actor_hp(actor, x, y, width = 124)
#~     draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
#~     change_color(system_color)
#~     draw_text(x, y, 30, line_height, Vocab::hp_a)
#~     draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
#~       hp_color(actor), normal_color)
#~   end
end[/pre]

修改后[pre lang="ruby" line="1"]class Window_MenuCommand < Window_Command
  
  def initialize
    super(0, Graphics.height - fitting_height(3))
    select_last
  end
  
  def make_command_list
    add_command(Vocab::item,   :item,   main_commands_enabled)
    add_command(Vocab::save, :save, save_enabled)
    add_command(Vocab::game_end, :game_end)
  end
end

class Window_MenuStatus < Window_Selectable

  def draw_actor_simple_status(actor, x, y)
    draw_actor_name(actor, x, y)
    draw_actor_level(actor, x, y + line_height * 1)
    draw_actor_icons(actor, x, y + line_height * 2)
    draw_actor_class(actor, x + 120, y) #绘制职业
    draw_actor_hp(actor, x + 120, y + line_height * 1)
  end
  
  def draw_item(index)
    actor = $game_party.members[index]
    enabled = $game_party.battle_members.include?(actor)
    rect = item_rect(index)
    draw_item_background(index)
    draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
    draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  end
end

class Scene_Menu < Scene_MenuBase
  def start
    super
    create_command_window
    create_status_window
    @status_window.arrows_visible = false
    @status_window.height = Graphics.height / 2 + 12
    @status_window.y = Graphics.height - @status_window.height
  end
end[/pre]
新建一个脚本页,黏贴进去

点评

差点撞车  发表于 2015-1-4 22:26

评分

参与人数 1梦石 +1 收起 理由
taroxd + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-10-7
回帖
19
 楼主| 发表于 2015-1-5 14:06:25 | 显示全部楼层
@VIPArcher 大致用成想要的结果 但人物的头重叠了 这样要改哪边呢><
体力下方的条状可以更改颜色吗?
2015-01-05_135652.png

点评

不好意思,由于我写完后并没有去测试过,忽略了这个问题,上面脚本已修正。  发表于 2015-1-5 22:51
回复

使用道具 举报

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-10-7
回帖
19
 楼主| 发表于 2015-1-7 11:06:36 | 显示全部楼层
@VIPArcher 谢谢!! 使用上都没有问题了(。◕∀◕。)
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部