赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 21 |
经验 | 0 |
最后登录 | 2024-8-6 |
在线时间 | 211 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 2075
- 在线时间
- 211 小时
- 注册时间
- 2018-4-23
- 帖子
- 119
|
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在某些情况下如果不出现的话,但头顶还会出现字…… |
|