赞 | 2 |
VIP | 335 |
好人卡 | 3 |
积分 | 1 |
经验 | 14077 |
最后登录 | 2020-1-28 |
在线时间 | 264 小时 |
Lv1.梦旅人 冰
- 梦石
- 0
- 星屑
- 142
- 在线时间
- 264 小时
- 注册时间
- 2006-11-22
- 帖子
- 1057
|
#--------------------------------------------------------------------------
# ○ 设置角色名字窗口
#--------------------------------------------------------------------------
def set_namewindow
# $mes_name为空时不显示角色名字窗口
if $mes_name == nil or $mes_name == ""
return
else
# 设定变量
mes_name = $mes_name
skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
#判断名称是否有对应的图片"Graphics/heads/" +
if $game_temp.namebmp[mes_name] == nil then
sFile = "Graphics/heads/" + mes_name + ".png"
else
sFile = "Graphics/heads/" + $game_temp.namebmp[mes_name] + ".png"
end
if FileTest.exist?(sFile) == true then
@face_pic_txt = 1 #名字窗口使用头像<- bbschat
# 生成头像
bmp = Bitmap.new(sFile)
@pic_width = bmp.width
@pic_height = bmp.height
if self.x >= @pic_width + 5
# 默认头像显示在对话框左边
name_x = self.x-@pic_width-5
else
# 对话框左边放不下时头像显示在右边
name_x = self.x + self.width
end
name_y = self.y+self.height/2 - (@pic_height + 5)/2
# 生成角色头像窗口
@name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
@name_win.windowskin = RPG::Cache.windowskin(skin)
@name_win.back_opacity =0
@name_win.z = self.z + 1
@name_contents = Sprite.new
@name_contents.x = name_x + 2
@name_contents.y = name_y + 2
@name_contents.bitmap = bmp
#@name_contents.z = @name_win.z + 2 #这个用了似乎效果不好<- bbschat
else
@face_pic_txt = 0 #名字窗口使用文字<- bbschat
# 生成名字
name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE
name_height = FUKI::NAME_FONT_SIZE
name_x = self.x + FUKI::NAME_SHIFT_X
name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y
# 生成角色名字窗口(只有边框)
@name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16)
@name_win.windowskin = RPG::Cache.windowskin(skin)
@name_win.opacity = 0
@name_win.z = self.z + 1
# 为了使空白比Windows类限定的更小使用双重结构
@name_contents = Sprite.new
@name_contents.x = name_x + 12
@name_contents.y = name_y + 8
@name_contents.bitmap = Bitmap.new(name_width, name_height)
@name_contents.z = @name_win.z + 2
# 设定文字色
nil_color = Color.new(0,0,0,0)
if FUKI::NAME_COLOR != nil_color
@name_contents.bitmap.font.color = FUKI::NAME_COLOR
else
@name_contents.bitmap.font.color = normal_color
end
@name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
# 调整窗口尺寸
rect = @name_contents.bitmap.text_size(mes_name)
@name_win.width = rect.width + 32
# 描画名字
@name_contents.bitmap.draw_text(rect, mes_name)
end
end
|
|