じ☆ve冰风 发表于 2025-1-24 17:42:14

地图上显示NPC名字

function npcName() {    this.initialize.apply(this, arguments);};npcName.prototype.initialize = function() {                this._PlayerColor = '#ffea00';                this._eventsName = [];      this._Player = new Sprite();      this._Player.bitmap = new Bitmap(300, 100);      // 处理事件name      var k = 0;      for(var i=0;i 1){                              this._eventsName.bitmap.textColor = $dataMap.events.name.split('@');                        };                        this._eventsName.bitmap.drawText(this._eventsName.name, 0, 0,this._eventsName.textW , 24, 'center');                        k++;                };      };                this._Player.textW = this._Player.bitmap.measureTextWidth($gameActors.actor(1).name());      this._Player.bitmap.textColor = this._PlayerColor;      this._Player.bitmap.drawText($gameActors.actor(1).name(), 0, 0,this._Player.textW, 24, 'center');                };npcName.prototype.update = function (){                         for(var i=0;i
页: [1]
查看完整版本: 地图上显示NPC名字