查看: 3782|回复: 1

[已经解决] 怎样修改物品/装备/技能栏里的行间距?【已自行解决】

[复制链接]
梦石
0
星屑
2338
在线时间
275 小时
注册时间
2017-7-25
回帖
128
发表于 2020-11-6 19:40:41 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 骷髅岛遗老 于 2020-11-8 14:10 编辑

用了一个修改物品图标的脚本:
  1. class RPG::BaseItem
  2.   #--------------------------------------------------------------------------
  3.   # ● 获取图标
  4.   #--------------------------------------------------------------------------
  5.   def get_icon
  6.     self.note.split(/[\r\n]+/).each { |line|
  7.       return $1 if line =~ /<ICON:(\S+)>/i
  8.     }
  9.     return nil
  10.   end
  11.   #--------------------------------------------------------------------------
  12.   # ● 图标 index
  13.   #--------------------------------------------------------------------------
  14.   alias vip_20140928_icon_index icon_index
  15.   def icon_index
  16.     return get_icon if get_icon
  17.     return vip_20140928_icon_index
  18.   end
  19. end
  20. class Window_Base
  21.   #--------------------------------------------------------------------------
  22.   # ● 绘制图标
  23.   #--------------------------------------------------------------------------
  24.   alias vip_20140928_draw_icon draw_icon
  25.   def draw_icon(icon_index, x, y, enabled = true)
  26.     if icon_index.is_a?(Integer)
  27.       vip_20140928_draw_icon(icon_index, x, y, enabled)
  28.     else
  29.       bitmap = Cache.load_bitmap("Graphics/Icons/", icon_index)
  30.       rect = Rect.new( 0, 0, 50, 50)
  31.       contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  32.     end
  33.   end
  34. end
复制代码

但是发现一旦东西多了在物品栏里就会:
呃.png
感觉似乎把行间距同步改大一点就能解决了,但是改了脚本以后发现所有的文字间距都变得非常巨大
所以求教一下如何精准修改物品/装备/技能栏的行间距,如果能在这个脚本里面改就更感激不尽了……
梦石
0
星屑
2338
在线时间
275 小时
注册时间
2017-7-25
回帖
128
 楼主| 发表于 2020-11-8 14:10:21 | 显示全部楼层

突然发现在Window_ItemList里插入
  def line_height
   return 48
  end
就能实现想要的效果了,接头霸王针不辍~
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部