| 赞 | 62 |
| VIP | |
| 好人卡 | |
| 积分 | 65 |
| 经验 | |
| 最后登录 | 2025-2-24 |
| 在线时间 | 1275 小时 |
百合控
- 梦石
- 0
- 星屑
- 6548
- 在线时间
- 1275 小时
- 注册时间
- 2013-8-21
- 回帖
- 3522

|
发表于 2015-11-19 10:33:04
|
显示全部楼层
本帖最后由 余烬之中 于 2015-11-19 11:30 编辑
[pre lang="javascript"](function() {
namepopplus_scpi = Sprite_Character.prototype.initialize;
Sprite_Character.prototype.initialize = function(character) {
namepopplus_scpi.call(this, character);
this._tempCharacter = character;
this._tempIsBigCharacter = ImageManager.isBigCharacter(character._characterName);
if (character instanceof Game_Event) {
matchreg = /namepop\s*(?:<\s*(\-)?(\d+)\s*,\s*(\-)?(\d+)\s*>)?/i;
matchres = character.event().note.match(matchreg);
if (matchres != null) {
xoffs = (matchres[1] === void 0 ? 1 : -1) * (matchres[2] || 0);
yoffs = (matchres[3] === void 0 ? 1 : -1) * (matchres[4] || 0);
this.createNamepopSet(xoffs, yoffs);
};
};
};
Sprite_Character.prototype.createNamepopSet = function() {
var height = this._tempIsBigCharacter ? 2 : 1;
this._namepopSprite = new Sprite();
this._namepopSprite.bitmap = new Bitmap(100, 20);
this._namepopSprite.bitmap.fontSize = 18;
this._namepopSprite.bitmap.drawText(this._tempCharacter.event().name, 0, 0, 100, 20, 'center');
this._namepopSprite.anchor.x = 0.5;
this._namepopSprite.anchor.y = 1;
this._namepopSprite.x = this.x + arguments[0];
this._namepopSprite.y = this.y + arguments[1] - height * 48;
this.addChild(this._namepopSprite);
};
}());[/pre] |
|