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

Project1

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

[已经解决] 关于系统菜单的图标美化

 关闭 [复制链接]

Lv2.观梦者

梦石
0
星屑
381
在线时间
1398 小时
注册时间
2010-9-23
帖子
557
跳转到指定楼层
1
发表于 2011-9-8 09:02:47 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 黑崎一护 于 2011-9-11 08:23 编辑

想在菜单的文字旁边再增加一个图标,在论坛里面看到了XP的脚本,请问vx该怎么修改脚本呢?

Lv1.梦旅人

梦石
0
星屑
50
在线时间
543 小时
注册时间
2009-7-13
帖子
63
2
发表于 2011-9-8 09:56:24 | 只看该作者
本帖最后由 nanaka 于 2011-9-8 13:10 编辑
  1. class Window_Command_With_Icon < Window_Selectable

  2.   attr_reader   :commands                 
  3.   
  4.   def initialize(width, commands, icon_list, column_max = 1, row_max = 0, spacing = 32)
  5.     if row_max == 0
  6.       row_max = (commands.size + column_max - 1) / column_max
  7.     end
  8.     super(0, 0, width, row_max * WLH + 32, spacing)
  9.     @commands = commands
  10.     @item_max = commands.size
  11.     @column_max = column_max
  12.     self.index = 0
  13.     @icon_list = icon_list
  14.     refresh
  15.   end

  16.   def refresh
  17.     self.contents.clear
  18.     for i in 0...@item_max
  19.       draw_item(i)
  20.     end
  21.   end

  22.   def draw_item(index, enabled = true)
  23.     rect = item_rect(index)
  24.     rect.x += 4
  25.     rect.width -= 8
  26.     icon_index = @icon_list[index]
  27.     if  index != nil and icon_index != 0
  28.       rect.x -= 4
  29.       draw_icon(icon_index, rect.x, rect.y, enabled)
  30.       rect.x += 26
  31.       rect.width -= 20
  32.     end
  33.     self.contents.clear_rect(rect)
  34.     self.contents.font.color = normal_color
  35.     self.contents.font.color.alpha = enabled ? 255 : 128
  36.     self.contents.draw_text(rect, @commands[index])
  37.   end
  38. end
复制代码
需要加图标的时候用这个类生成实例,第三个参数是图标的序号的数组
比如@command_window = Window_Command_With_Icon.new(172, [s1, s2, s3], [3,5,7])

点评写不下了……
Scene_Menu60行左右改成
@command_window = Window_Command_With_Icon.new(160, [s1, s2, s3, s4, s5, s6],[这里填你想加的图标序号])

点评

谢谢您的热心帮助~!我明白了~!  发表于 2011-9-9 09:20
不……比如你想改Scene_Menu的菜单 就把大约60行的 @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) 换成Window_Command_With_Icon.new参数改一下  发表于 2011-9-8 13:08
@command_window = Window_Command_With_Icon.new(172, [s1, s2, s3], [3,5,7]) 请问是插在这个脚本的第四行?  发表于 2011-9-8 12:26
退屈すぎ…
回复 支持 反对

使用道具 举报

Lv4.逐梦者

醉啸 长风万里

梦石
0
星屑
6047
在线时间
6586 小时
注册时间
2007-12-16
帖子
4501

贵宾

3
发表于 2011-9-8 12:40:46 手机端发表。 | 只看该作者
我的三合一的那个帖子拿来看看吧

还在龟速填坑中
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
678 小时
注册时间
2010-8-11
帖子
1533
4
发表于 2011-9-8 19:11:26 | 只看该作者
是不是像这样的?

众:你只是在晒自己的菜单而已吧~~
小艾工作室开张= =
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 11:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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