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

Project1

 找回密码
 注册会员
搜索

关于图标显示问题

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

正文摘要:

想要用自己的图标,直接用png图,求个脚本,谢了。 转载的图,就这样的直接用。

回复

类人猿 发表于 2015-9-23 18:48:03
翻滚牛宝宝 发表于 2015-9-23 10:11
http://rpg.blue/forum.php?mod=viewthread&tid=222506 原帖地址
使用方法:
将图标文件放在 游戏根目 ...

谢了                           
翻滚牛宝宝 发表于 2015-9-23 10:11:21
本帖最后由 翻滚牛宝宝 于 2015-9-23 10:15 编辑

http://rpg.blue/forum.php?mod=viewthread&tid=222506 原帖地址
使用方法:
将图标文件放在 游戏根目录/Graphics/Icons 里面
在数据库的物品/武器/防具/技能/状态中的备注里面写 [icon 文件名]

  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+)\]/
  8.     }
  9.     return nil
  10.   end
  11.   #--------------------------------------------------------------------------
  12.   # ● 图标 index
  13.   #--------------------------------------------------------------------------
  14.   alias draw_single_icon_icon_index icon_index
  15.   def icon_index
  16.     icon_index = get_icon
  17.     # 如果有指定图标
  18.     if icon_index && icon_index =~ /\d+/ # 如果指定的是數字
  19.       @icon_index = icon_index.to_i # 轉換成數字
  20.     elsif icon_index
  21.       return icon_index # 返回指定图标文件名
  22.     end
  23.     return draw_single_icon_icon_index # 否则返回原本的图标 index
  24.   end
  25. end
  26. class Window_Base
  27.   #--------------------------------------------------------------------------
  28.   # ● 绘制图标
  29.   #--------------------------------------------------------------------------
  30.   alias draw_single_icon_draw_icon draw_icon
  31.   def draw_icon(icon_index, x, y, enabled = true)
  32.     if icon_index.is_a?(Integer) # 判断是否为整数
  33.       # 调用原本的绘制图标方法
  34.       draw_single_icon_draw_icon(icon_index, x, y, enabled)
  35.     else # 指定图标时
  36.       bitmap = Cache.load_bitmap("Graphics/Icons/", icon_index)
  37.       rect = Rect.new(0, 0, 24, 24)
  38.       contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  39.     end
  40.   end
  41. end
复制代码
这个脚本也可以

评分

参与人数 1星屑 +200 收起 理由
taroxd + 200 认可答案

查看全部评分

御之嵐 发表于 2015-9-22 22:46:00
稍微拼湊了一下
雖然不知道你是不是要弄成這樣就是了



因為是直接縮放
所以會有失真、模糊的現象
藥罐的顏色很複雜所以字體幾乎看不見 ( 艸)
我盡力了・゚・(つД`)・゚・。

測試了一下
似乎沒有錯位的現象_(:з」∠)_

如果覺得還可以接受的話
就拿走吧ლ(・ω・ლ)
翻滚牛宝宝 发表于 2015-9-22 21:34:11
类人猿 发表于 2015-9-22 21:30:40
黄濑凉太 发表于 2015-9-22 20:59
直接拼比较好吧

位子老是不对               
黄濑凉太 发表于 2015-9-22 20:59:37
直接拼比较好吧
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-9-24 18:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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