本帖最后由 a107480098 于 2014-9-14 04:37 编辑 为什么NPC不显示名字?脚本没有问题。为什么换上别的人物行走图就会显示名字?也有的换上别的人物行走图也不显示名字?NPC名字不显示和人物行走图的尺寸大小有关 ...
a107480098 发表于 2014-9-14 17:31 你好!对不起,工程1G多,无法上传。附上脚本。 #==================================================== ...
︶ㄣ牛排ぶ 发表于 2014-9-14 08:22 楼主把脚本也贴上来吧 只有图不够用……
#==============================================================================# ■ Sprite_Character#------------------------------------------------------------------------------# 角色显示用脚本。监视 Game_Character 类的实例、# 自动变化脚本状态。#============================================================================== class Sprite_Character < RPG::Sprite #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_accessor :character # 角色 #-------------------------------------------------------------------------- # ● 初始化对像 # viewport : 查看端口 # character : 角色 (Game_Character) #-------------------------------------------------------------------------- def initialize(viewport, character = nil) super(viewport) @character = character # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ #draw_actor_Aspecialname name = character.name @namesprite = Sprite.new @namesprite.bitmap = Bitmap.new(160, 48) @namesprite.bitmap.font.name = "新宋体","仿宋_GB2312" @namesprite.bitmap.font.size = 18 @namesprite.bitmap.font.color.set(255, 0, 50, 255) # 黄色(255, 0, 50, 255) # 绿色(0, 255, 255, 255) @evname = name @evname_split = name.split(/,/)[0] if name.split(/,/)[1] != nil case name.split(/,/)[1] when "0" @namesprite.bitmap.font.color.set(255, 255, 255) when "1" @namesprite.bitmap.font.color.set(228, 228, 255) when "2" @namesprite.bitmap.font.color.set(255, 128, 128) when "3" @namesprite.bitmap.font.color.set(128, 255, 128) when "4" @namesprite.bitmap.font.color.set(128, 255, 255) when "5" @namesprite.bitmap.font.color.set(255, 128, 255) when "6" @namesprite.bitmap.font.color.set(255, 255, 128) when "7" @namesprite.bitmap.font.color.set(192, 192, 192) else @namesprite.bitmap.font.color.set(255, 255, 255) end end if $game_variables[44] == 0 @namesprite.bitmap.font.color.set(0, 255, 0, 225)#0转 elsif $game_variables[44] == 1 @namesprite.bitmap.font.color.set(255, 176, 0, 225)#1转 elsif $game_variables[44] == 2 @namesprite.bitmap.font.color.set(54, 224, 237, 225)#2转 elsif $game_variables[44] == 3 @namesprite.bitmap.font.color.set(255, 0, 0, 225)#3转 end if @evname_split != "" and @evname_split != nil @namesprite.bitmap.draw_text(0, 0, 160, 36, @evname_split, 1) end # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ update end #-------------------------------------------------------------------------- # ● 更新画面 #-------------------------------------------------------------------------- def update super # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ if @evname != @character.name @namesprite.bitmap.clear end if @character_name == "111111" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "天山雪-D1" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "大理" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "虾兵" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "龟丞相" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "小龙女" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "长寿老人" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "驿站老板" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "杂货" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "服装" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "药店" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "铁匠" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "天地人" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "酒店" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "帮主" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "程夫人" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "彩衣仙子" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "镇元大仙" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "渔夫" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼2" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "当铺" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "强盗" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 170 # 显示坐标 end if @character_name == "小鬼3" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼4" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "伶俐鬼" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "11111" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "白虎" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "钟魁" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "孟婆" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "白无常" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "李靖" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "独眼巨人" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 160 # 显示坐标 end if @character_name == "六臂魔王" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "黑熊精" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 150 # 显示坐标 end if @character_name == "天NPC" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "黑山妖王" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "仙女" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "哪吒" @namesprite.x = self.x - 65 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "杨戬" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "玉帝" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "王母娘娘" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "女仙坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "铁匠" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "铁匠1" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "复件 逍遥女-D1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "复件 飞剑侠-D1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "大大王" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "九头精怪" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "判官" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "黑无常" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "秦广王" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "福星" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "玲珑仙11" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "乞丐" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "女儿村" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "车夫" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "沙和尚" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "猪八戒" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 140 # 显示坐标 end if @character_name == "雷鸟" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "牛妖" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "三十娘" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "老人" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "县令" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "玄藏" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小和尚" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "老和尚" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "紫霞" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "观音" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "情花" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "法术指导员" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "倭寇" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "复件 纯阳子-D1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "财神" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "剑侠客" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "猛壮士" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "俏千金" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "红拂女" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "英女侠" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 75 # 显示坐标 end if @character_name == "夺命妖" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "虎头魔" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "牛头魔" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "复件 媚灵狐-D1" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "复件 骨精灵-D1" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "骨精灵" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "九尾狐" @namesprite.x = self.x - 85 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "小蛮妖" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "神天兵" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 125 # 显示坐标 end if @character_name == "龙太子" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "老君仙" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "玲珑仙" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "舞天姬" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "白天丝" @namesprite.x = self.x - 85 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "1帮派" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "1zx" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "1xy" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "逍遥生" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "阴长生" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 110 # 显示坐标 end if @character_name == "祭剑魂" @namesprite.x = self.x - 73 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "猎狐引" @namesprite.x = self.x - 73 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小婷" @namesprite.x = self.x - 73 # 显示坐标 @namesprite.y = self.y - self.oy + 110 # 显示坐标 end if @character_name == "幽梦影" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 170 # 显示坐标 end if @character_name == "小雪" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "纯阳子" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "飞剑侠" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "逍遥女" @namesprite.x = self.x - 72 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "逆天魔" @namesprite.x = self.x - 72 # 显示坐标 @namesprite.y = self.y - self.oy + 115 # 显示坐标 end if @character_name == "媚灵狐" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "武尊神" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "玄天姬" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "英婉儿" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "混天魔" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 125 # 显示坐标 end if @character_name == "灵仙狐" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 105 # 显示坐标 end if @character_name == "至尊神" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "舞灵仙" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 165 # 显示坐标 end if @character_name == "纯阳子坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 155 # 显示坐标 end if @character_name == "男人坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 155 # 显示坐标 end if @character_name == "逍遥女坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "男魔坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "媚灵狐坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "男仙坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女仙坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "女人坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "混天魔坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "女魔坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女人坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2男人坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2男仙坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女仙坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女魔坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2男魔坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "小倩坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2小雪坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2小婷坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2祭剑魂坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2猎狐引坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2阴长生坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "至尊仙坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "舞灵仙坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "阴长生坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "祭剑魂坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "猎狐引坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "小婷坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "小倩坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "小雪坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end # 如果使用不同规格的素材,最好的区别方法就是文件名,不同规格的素材 # 可以根据文件名来设置不同的显示坐标,举例: #elsif @character_name == "" #@namesprite.x = self.x - 80 # 显示坐标 #@namesprite.y = self.y - self.oy - 24 + 125 # 显示坐标 #else # @specialnamesprite.x = self.x - 80 # 显示坐标 # @specialnamesprite.y = self.y - self.oy + 135 # 显示坐标 # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ # 元件 ID、文件名、色相与现在的情况存在差异的情况下 if @tile_id != @character.tile_id or @character_name != @character.character_name or @character_hue != @character.character_hue # 记忆元件 ID 与文件名、色相 @tile_id = @character.tile_id @character_name = @character.character_name @character_hue = @character.character_hue # 元件 ID 为有效值的情况下 if @tile_id >= 384 self.bitmap = RPG::Cache.tile($game_map.tileset_name, @tile_id, @character.character_hue) self.src_rect.set(0, 0, 32, 32) self.ox = 16 self.oy = 32 # 元件 ID 为无效值的情况下 else self.bitmap = RPG::Cache.character(@character.character_name, @character.character_hue) # 素材处理★★★★★★★★★★★★★★★★★★★★★★★★★★★ # 需要使用特殊的素材文件名为识别处理的情况时!列如: # 当素材文件名为“场所移动”时,对该素材处理方法 if @character_name == "场所移动" @cw = bitmap.width / 19 @ch = bitmap.height # 除此以外,其他素材和角色行走图等素材的处理 else @cw = bitmap.width / 8 @ch = bitmap.height / 8 end # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ self.ox = @cw / 2 self.oy = @ch end end # 设置可视状态 self.visible = (not @character.transparent) # 图形是角色的情况下 if @tile_id == 0 # 设置传送目标的矩形 sx = @character.pattern * @cw # 八向素材处理★★★★★★★★★★★★★★★★★★★★★★★★★★★ # 需要使用特殊的素材文件名为识别处理的情况时!列如: if @character_name == "场所移动" sy = 0 * @ch else case @character.direction when 2 sy = 0 * @ch # 下 when 4 sy = 1 * @ch # 左 when 6 sy = 2 * @ch # 右 when 8 sy = 3 * @ch # 上 when 1 sy = 4 * @ch # 左下 when 3 sy = 5 * @ch # 右下 when 7 sy = 6 * @ch # 左上 when 9 sy = 7 * @ch # 右上 end end # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ self.src_rect.set(sx, sy, @cw, @ch) end # 设置脚本的坐标 self.x = @character.screen_x self.y = @character.screen_y self.z = @character.screen_z(@ch) # 设置不透明度、合成方式、茂密 self.opacity = @character.opacity self.blend_type = @character.blend_type self.bush_depth = @character.bush_depth # 动画 if @character.animation_id != 0 animation = $data_animations[@character.animation_id] animation(animation, true) @character.animation_id = 0 end endend
#============================================================================== # ■ Sprite_Character #------------------------------------------------------------------------------ # 角色显示用脚本。监视 Game_Character 类的实例、 # 自动变化脚本状态。 #============================================================================== class Sprite_Character < RPG::Sprite #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_accessor :character # 角色 #-------------------------------------------------------------------------- # ● 初始化对像 # viewport : 查看端口 # character : 角色 (Game_Character) #-------------------------------------------------------------------------- def initialize(viewport, character = nil) super(viewport) @character = character # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ #draw_actor_Aspecialname name = character.name @namesprite = Sprite.new @namesprite.bitmap = Bitmap.new(160, 48) @namesprite.bitmap.font.name = "新宋体","仿宋_GB2312" @namesprite.bitmap.font.size = 18 @namesprite.bitmap.font.color.set(255, 0, 50, 255) # 黄色(255, 0, 50, 255) # 绿色(0, 255, 255, 255) @evname = name @evname_split = name.split(/,/)[0] if name.split(/,/)[1] != nil case name.split(/,/)[1] when "0" @namesprite.bitmap.font.color.set(255, 255, 255) when "1" @namesprite.bitmap.font.color.set(228, 228, 255) when "2" @namesprite.bitmap.font.color.set(255, 128, 128) when "3" @namesprite.bitmap.font.color.set(128, 255, 128) when "4" @namesprite.bitmap.font.color.set(128, 255, 255) when "5" @namesprite.bitmap.font.color.set(255, 128, 255) when "6" @namesprite.bitmap.font.color.set(255, 255, 128) when "7" @namesprite.bitmap.font.color.set(192, 192, 192) else @namesprite.bitmap.font.color.set(255, 255, 255) end end if $game_variables[44] == 0 @namesprite.bitmap.font.color.set(0, 255, 0, 225)#0转 elsif $game_variables[44] == 1 @namesprite.bitmap.font.color.set(255, 176, 0, 225)#1转 elsif $game_variables[44] == 2 @namesprite.bitmap.font.color.set(54, 224, 237, 225)#2转 elsif $game_variables[44] == 3 @namesprite.bitmap.font.color.set(255, 0, 0, 225)#3转 end if @evname_split != "" and @evname_split != nil @namesprite.bitmap.draw_text(0, 0, 160, 36, @evname_split, 1) end # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ update end #-------------------------------------------------------------------------- # ● 更新画面 #-------------------------------------------------------------------------- def update super # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ if @evname != @character.name @namesprite.bitmap.clear end if @character_name == "111111" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "天山雪-D1" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "大理" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "虾兵" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "龟丞相" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "小龙女" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "长寿老人" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "驿站老板" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "杂货" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "服装" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "药店" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "铁匠" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "天地人" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "酒店" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "帮主" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "程夫人" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "彩衣仙子" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "镇元大仙" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "渔夫" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼2" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "当铺" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "强盗" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 170 # 显示坐标 end if @character_name == "小鬼3" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小鬼4" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "伶俐鬼" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "11111" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "白虎" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "钟魁" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "孟婆" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "白无常" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "李靖" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "独眼巨人" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 160 # 显示坐标 end if @character_name == "六臂魔王" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "黑熊精" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 150 # 显示坐标 end if @character_name == "天NPC" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "黑山妖王" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "仙女" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "哪吒" @namesprite.x = self.x - 65 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "杨戬" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "玉帝" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "王母娘娘" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "女仙坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "铁匠" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "铁匠1" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "复件 逍遥女-D1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "复件 飞剑侠-D1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "大大王" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "九头精怪" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "判官" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "黑无常" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "秦广王" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "福星" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "玲珑仙11" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "乞丐" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "女儿村" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "车夫" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "沙和尚" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "猪八戒" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 140 # 显示坐标 end if @character_name == "雷鸟" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "牛妖" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "三十娘" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "老人" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "县令" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "玄藏" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小和尚" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "老和尚" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "紫霞" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "观音" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 60 # 显示坐标 end if @character_name == "情花" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "法术指导员" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "倭寇" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "复件 纯阳子-D1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "财神" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "剑侠客" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "猛壮士" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "俏千金" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "红拂女" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "英女侠" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 75 # 显示坐标 end if @character_name == "夺命妖" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "虎头魔" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "牛头魔" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "复件 媚灵狐-D1" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "复件 骨精灵-D1" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "骨精灵" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "九尾狐" @namesprite.x = self.x - 85 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "小蛮妖" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "神天兵" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 125 # 显示坐标 end if @character_name == "龙太子" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "老君仙" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "玲珑仙" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "舞天姬" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "白天丝" @namesprite.x = self.x - 85 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "1帮派" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "1zx" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "1xy" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 80 # 显示坐标 end if @character_name == "逍遥生" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "阴长生" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 110 # 显示坐标 end if @character_name == "祭剑魂" @namesprite.x = self.x - 73 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "猎狐引" @namesprite.x = self.x - 73 # 显示坐标 @namesprite.y = self.y - self.oy + 90 # 显示坐标 end if @character_name == "小婷" @namesprite.x = self.x - 73 # 显示坐标 @namesprite.y = self.y - self.oy + 110 # 显示坐标 end if @character_name == "幽梦影" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 170 # 显示坐标 end if @character_name == "小雪" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "纯阳子" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "飞剑侠" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 100 # 显示坐标 end if @character_name == "逍遥女" @namesprite.x = self.x - 72 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "逆天魔" @namesprite.x = self.x - 72 # 显示坐标 @namesprite.y = self.y - self.oy + 115 # 显示坐标 end if @character_name == "媚灵狐" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 85 # 显示坐标 end if @character_name == "武尊神" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "玄天姬" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "英婉儿" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 95 # 显示坐标 end if @character_name == "混天魔" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 125 # 显示坐标 end if @character_name == "灵仙狐" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 105 # 显示坐标 end if @character_name == "至尊神" @namesprite.x = self.x - 75 # 显示坐标 @namesprite.y = self.y - self.oy + 120 # 显示坐标 end if @character_name == "舞灵仙" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 165 # 显示坐标 end if @character_name == "纯阳子坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 155 # 显示坐标 end if @character_name == "男人坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 155 # 显示坐标 end if @character_name == "逍遥女坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "男魔坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "媚灵狐坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "男仙坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女仙坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "女人坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "混天魔坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "女魔坐骑" @namesprite.x = self.x - 80 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女人坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2男人坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2男仙坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女仙坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2女魔坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2男魔坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "小倩坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2小雪坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2小婷坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2祭剑魂坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2猎狐引坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "2阴长生坐骑1" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "至尊仙坐骑" @namesprite.x = self.x - 60 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "舞灵仙坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 145 # 显示坐标 end if @character_name == "阴长生坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "祭剑魂坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "猎狐引坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "小婷坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "小倩坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end if @character_name == "小雪坐骑" @namesprite.x = self.x - 70 # 显示坐标 @namesprite.y = self.y - self.oy + 135 # 显示坐标 end # 如果使用不同规格的素材,最好的区别方法就是文件名,不同规格的素材 # 可以根据文件名来设置不同的显示坐标,举例: #elsif @character_name == "" #@namesprite.x = self.x - 80 # 显示坐标 #@namesprite.y = self.y - self.oy - 24 + 125 # 显示坐标 #else # @specialnamesprite.x = self.x - 80 # 显示坐标 # @specialnamesprite.y = self.y - self.oy + 135 # 显示坐标 # 事件显示名字脚本加强★★★★★★★★★★★★★★★★★★★★★★★★★ # 元件 ID、文件名、色相与现在的情况存在差异的情况下 if @tile_id != @character.tile_id or @character_name != @character.character_name or @character_hue != @character.character_hue # 记忆元件 ID 与文件名、色相 @tile_id = @character.tile_id @character_name = @character.character_name @character_hue = @character.character_hue # 元件 ID 为有效值的情况下 if @tile_id >= 384 self.bitmap = RPG::Cache.tile($game_map.tileset_name, @tile_id, @character.character_hue) self.src_rect.set(0, 0, 32, 32) self.ox = 16 self.oy = 32 # 元件 ID 为无效值的情况下 else self.bitmap = RPG::Cache.character(@character.character_name, @character.character_hue) # 素材处理★★★★★★★★★★★★★★★★★★★★★★★★★★★ # 需要使用特殊的素材文件名为识别处理的情况时!列如: # 当素材文件名为“场所移动”时,对该素材处理方法 if @character_name == "场所移动" @cw = bitmap.width / 19 @ch = bitmap.height # 除此以外,其他素材和角色行走图等素材的处理 else @cw = bitmap.width / 8 @ch = bitmap.height / 8 end # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ self.ox = @cw / 2 self.oy = @ch end end # 设置可视状态 self.visible = (not @character.transparent) # 图形是角色的情况下 if @tile_id == 0 # 设置传送目标的矩形 sx = @character.pattern * @cw # 八向素材处理★★★★★★★★★★★★★★★★★★★★★★★★★★★ # 需要使用特殊的素材文件名为识别处理的情况时!列如: if @character_name == "场所移动" sy = 0 * @ch else case @character.direction when 2 sy = 0 * @ch # 下 when 4 sy = 1 * @ch # 左 when 6 sy = 2 * @ch # 右 when 8 sy = 3 * @ch # 上 when 1 sy = 4 * @ch # 左下 when 3 sy = 5 * @ch # 右下 when 7 sy = 6 * @ch # 左上 when 9 sy = 7 * @ch # 右上 end end # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ self.src_rect.set(sx, sy, @cw, @ch) end # 设置脚本的坐标 self.x = @character.screen_x self.y = @character.screen_y self.z = @character.screen_z(@ch) # 设置不透明度、合成方式、茂密 self.opacity = @character.opacity self.blend_type = @character.blend_type self.bush_depth = @character.bush_depth # 动画 if @character.animation_id != 0 animation = $data_animations[@character.animation_id] animation(animation, true) @character.animation_id = 0 end end end
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-23 12:56
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.