赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 23330 |
最后登录 | 2021-2-21 |
在线时间 | 13 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 65
- 在线时间
- 13 小时
- 注册时间
- 2008-1-11
- 帖子
- 330
|
给你个实践中的做法````我的游戏就用了
在Window_Base里,找到以下:
#--------------------------------------------------------------------------
# ● 描绘物品名
# item : 物品
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
#--------------------------------------------------------------------------
def draw_item_name(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name)
end
在这里加上
def draw_actor_face(actor, x, y)
bitmap = RPG::Cache.picture(actor.character_name)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
然后放一张与角色行走图同名的图片“就是你要在战斗画面中显示的”在Pictures目录下就可以 |
|