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

Project1

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

[已经解决] 单一状态图标

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2014-1-13
帖子
57
跳转到指定楼层
1
发表于 2014-9-28 20:45:07 手机端发表。 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
一些小图标我不想用iconset,而想用单张照片

Lv4.逐梦者 (版主)

无限の剣制

梦石
0
星屑
10073
在线时间
5020 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

2
发表于 2014-9-28 21:09:58 | 只看该作者
本帖最后由 VIPArcher 于 2014-9-28 21:58 编辑
  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, 24, 24)
  31.       contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  32.     end
  33.   end
  34. end
复制代码
使用方法:物品/技能/状态备注栏备注<ICON:文件名>
文件放在"Graphics/Icons/"文件夹下(自己新建一个)

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2014-1-13
帖子
57
3
 楼主| 发表于 2014-9-28 22:25:37 手机端发表。 | 只看该作者
谢,已解决
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-26 03:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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