赞 | 2 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 14543 |
最后登录 | 2017-11-25 |
在线时间 | 200 小时 |
Lv1.梦旅人 神之首
- 梦石
- 0
- 星屑
- 65
- 在线时间
- 200 小时
- 注册时间
- 2011-2-7
- 帖子
- 220
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 陆娘 于 2016-9-9 09:37 编辑
- 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<$dataMap.events.length;i++){
- if($dataMap.events[i]){
- this._eventsName[k] = new Sprite();
- this._eventsName[k].id = $dataMap.events[i].id;
- this._eventsName[k].name = $dataMap.events[i].name.split('@')[0];
- this._eventsName[k].bitmap = new Bitmap(300, 100);
- this._eventsName[k].textW = this._eventsName[k].bitmap.measureTextWidth(this._eventsName[k].name);
- if($dataMap.events[i].name.split('@').length > 1){
- this._eventsName[k].bitmap.textColor = $dataMap.events[i].name.split('@')[1];
- };
- this._eventsName[k].bitmap.drawText(this._eventsName[k].name, 0, 0,this._eventsName[k].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<this._eventsName.length;i++){
- this._eventsName[i].x = $gameMap.event(this._eventsName[i].id)._realX*48-$gameMap._displayX*48- this._eventsName[i].textW/2+24;
- this._eventsName[i].y = $gameMap.event(this._eventsName[i].id)._realY*48-$gameMap._displayY*48-24;
- };
- this._Player.x = $gamePlayer._realX*48-$gameMap._displayX*48- this._Player.textW/2+24;
- this._Player.y = $gamePlayer._realY*48-$gameMap._displayY*48-24;
-
- };
- npcName.prototype.go = function (){
- for(var i=0;i<this._eventsName.length;i++){
- this.scene.addChild(this._eventsName[i]);
- };
- this.scene.addChild(this._Player);
- };
- Scene_Map.prototype.createDisplayObjects2 = Scene_Map.prototype.createDisplayObjects;
- Scene_Map.prototype.createDisplayObjects = function () {
- this.createDisplayObjects2();
- this.npcName = new npcName();
- this.npcName.scene = this;
- this.npcName.go();
- console.log($gameMap);
- };
- Scene_Map.prototype.update2 = Scene_Map.prototype.update;
- Scene_Map.prototype.update = function (){
- this.update2();
- this.npcName.update();
- };
复制代码
主角的颜色直接在插件里面更改 搜索 this._PlayerColor = '#ffea00'; this._PlayerColor = '我要修改的颜色(CSS类型)';
事件的颜色直接在昵称那里设置xxx@颜色。
|
评分
-
查看全部评分
|