- 注册时间
- 2009-12-30
- 最后登录
- 2019-6-30
②入门
- 积分
- 89
|
代码:- #在Graphic的Icons文件夹下,把要用的图标放在里面
- #在物品、技能的备注里面写 就能调用该图标了 没有写的调用在数据库设置的图标
- #只支援默认24X24的图标,要大图标的话请自己修改窗口等
- class Window_Base
- def draw_icon2(icon_file, x, y, enabled = true)
- bitmap = Cache.load_bitmap("Graphics/Icons/", icon_file)
- rect = Rect.new(0, 0, 24, 24)
- self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
- end
- def draw_item_name(item, x, y, enabled = true)
- if item != nil
- if item.get_icon
- draw_icon2(item.get_icon.to_s, x, y, enabled)
- else
- draw_icon(item.icon_index, x, y, enabled)
- end
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(x + 24, y, 172, WLH, item.name)
- end
- end
- end
- module Item
- ICON = /<ICON (.*)>/i
- end
- class RPG::BaseItem
- def get_icon
- self.note.split(/[\r\n]+/).each { |line|
- return $1 if line =~ Item::ICON
- }
- return nil
- end
- end
复制代码 要在物品、技能的备注里面写什么呀? |
|