设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 715|回复: 1
打印 上一主题 下一主题

[有事请教] popname插件事件没出现但是头上还会显示文字

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2065
在线时间
209 小时
注册时间
2018-4-23
帖子
119
跳转到指定楼层
1
发表于 2023-6-29 13:16:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
20星屑
本帖最后由 pajiman1999 于 2023-6-29 13:19 编辑

popname插件事件没出现但是头上还会显示文字  如何修改呀?

代码如下

(function() {
        _Sprite_Character_prototype_initialize = Sprite_Character.prototype.initialize;
        Sprite_Character.prototype.initialize = function(character) {
                _Sprite_Character_prototype_initialize.call(this, character);
                this._tempCharacter = character;
                if (character instanceof Game_Event) {
                        if (character.event().note.match("NAMEPOP") != null) {
                                var notetext = character.event().note.split("|");
                                this._namepopY = Number(notetext[1]) || 1;
                                this._fontSize = Number(notetext[2]) || 18;
                                this.createNamepopSet();
                        }
                }
        };

        Sprite_Character.prototype.createNamepopSet = function() {
                var h = this._fontSize;
                this._namepopSprite = new Sprite();
                this._namepopSprite.bitmap = new Bitmap(h * 10, h);
                this._namepopSprite.bitmap.fontSize = h;
                this._namepopSprite.bitmap.drawText(this._tempCharacter.event().name, 0, 0, h * 10, h, 'center');
                this._namepopSprite.anchor.x = 0.5;
                this._namepopSprite.anchor.y = 1;
                this._namepopSprite.y = this.y - this._namepopY * 48;
                this.addChild(this._namepopSprite);
        };
}());

事件备注 NAMEPOP|1|26|rgba(255,255,255,1)  然后NPC在某些情况下如果不出现的话,但头顶还会出现字……

Lv4.逐梦者

梦石
0
星屑
7020
在线时间
717 小时
注册时间
2021-3-5
帖子
819
2
发表于 2023-6-30 22:15:11 | 只看该作者
不用修改,直接删掉,然后换钻头群主的漂浮文字插件即可
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-22 04:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表