赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 670 |
最后登录 | 2018-9-22 |
在线时间 | 0 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 55
- 在线时间
- 0 小时
- 注册时间
- 2007-4-8
- 帖子
- 92
|
3楼

楼主 |
发表于 2008-8-7 06:27:15
|
只看该作者
#--------------------------------------------------------------------------
# ○ 设置呼出对话框
#--------------------------------------------------------------------------
def set_fukidasi(x, y, width, height)
begin
# 不显示暂停标志
self.pause = false
# 取得对话框位置
pos = get_fuki_pos(width, height)
x = pos[0]
y = pos[0]
skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
# 生成呼出对话框
self.windowskin = RPG::Cache.windowskin(skin)
self.x = x
self.y = y
self.height = height
self.width = width
self.contents.dispose
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = FUKI::FUKI_OPACITY
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = FUKI::MES_FONT_SIZE
# 描绘尾部图标
if $game_system.message_frame == 0
# 取得位置
tale_pos = get_tale_pos
@tale = Sprite.new
# 是否显示尾部图标 <- bbschat
if FUKI::TAIL_SHOW == true
case @message_position
when 0 # 上
@tale.bitmap = RPG::Cache.windowskin(skin + "-top")
@tale.x = tale_pos[0]
@tale.y = tale_pos[1]
@tale.z = self.z + 1
when 1 # 中
@tale.dispose
@tale = nil
when 2 # 下
@tale.bitmap = RPG::Cache.windowskin(skin + "-under")
@tale.x = tale_pos[0]
@tale.y = tale_pos[1]
@tale.z = self.z + 1
end
end
end
rescue
del_fukidasi
reset_window(width, height)
end
end
#--------------------------------------------------------------------------
# ○ 新功能:根据输入文章计算呼出对话框的位置
#--------------------------------------------------------------------------
def get_character_KKME
if @kkme_name == "" or @kkme_name == nil
return nil
else
@kkme_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
$mes_name = @kkme_name
for ev in $game_map.events.values
if ev.name == @kkme_name
return ev
end
end
for actor in $game_party.actors
if actor.name == @kkme_name
return $game_player
end
end
return nil
end
end
#--------------------------------------------------------------------------
# ○ 计算呼出对话框的位置
#--------------------------------------------------------------------------
def get_fuki_pos(width, height)
# 取得角色
if $mes_id != nil
@character = get_character($mes_id)
else
@character = get_character_KKME
end
if @character == nil
# 角色不存在的情况下使用默认信息框
del_fukidasi
reset_window(width, height)
return
end
# 处理坐标
x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
# 为尽量显示在画面内而移动横坐标
if x + width > 640
x = 640 - width
elsif x < 0
x = 0
end
# 决定窗口位置
case $game_system.message_position
when 0 # 上
y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
when 1 # 中
y = (480 - height) / 2
x = (640 - width) / 2
when 2 # 下
y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
end
# 纪录文章显示位置
@message_position = $game_system.message_position
# 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
if FUKI::POS_FIX
case @message_position
when 0 # 上
if y <= 0
@message_position = 2
y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
end
when 2 # 下
if y + height >= 480
@message_position = 0
y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
end
end
end
return [x,y]
end
我不想要这个对话框自动掸出来,怎么做? |
|