查看: 2307|回复: 2

[已经解决] 图标扩大

[复制链接]
梦石
0
星屑
50
在线时间
46 小时
注册时间
2014-1-13
回帖
21
发表于 2014-11-13 20:05:21 来自手机 | 显示全部楼层 |阅读模式

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

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

×
可不可以自定义图标大小?

闇吼者の災悪眷族

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
回帖
6408
发表于 2014-11-13 20:59:09 | 显示全部楼层
可以,而且不难。
在Window_Base中修改draw_icon(icon_index, x, y, enabled = true) 的方法
修改括号类对应的参数,就可以从描绘出不同大小的图标。

但是会影响整个游戏中所有图标的描绘方法,会导致很多显示出现问题。
很多行间距局,列宽都要手动做一次调整。
回复

使用道具 举报

无限の剣制

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

开拓者贵宾

发表于 2014-11-13 22:22:12 | 显示全部楼层
本帖最后由 VIPArcher 于 2014-11-13 22:29 编辑

https://rpg.blue/thread-371989-1-1.html
以前给你弄的这个,稍微改一改。
[pre lang="ruby" line="1"]class RPG::BaseItem
  #--------------------------------------------------------------------------
  # ● 获取图标
  #--------------------------------------------------------------------------
  def get_icon
    self.note.split(/[\r\n]+/).each { |line|
      return $1 if line =~ /<ICON:(\S+)>/i
    }
    return nil
  end
  #--------------------------------------------------------------------------
  # ● 图标 index
  #--------------------------------------------------------------------------
  alias vip_20140928_icon_index icon_index
  def icon_index
    return get_icon if get_icon
    return vip_20140928_icon_index
  end
end
class Window_Base
  #--------------------------------------------------------------------------
  # ● 绘制图标
  #--------------------------------------------------------------------------
  alias vip_20140928_draw_icon draw_icon
  def draw_icon(icon_index, x, y, enabled = true)
    if icon_index.is_a?(Integer)
      vip_20140928_draw_icon(icon_index, x, y, enabled)
    else
      bitmap = Cache.load_bitmap("Graphics/Icons/", icon_index)
      rect = Rect.new(0, 0, bitmap.width, bitmap.height)
      contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    end
  end
end
[/pre]
你就可以用大图标了,当然前提是绘制图标的地方需要足够大。

评分

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

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部