Project1

标题: Namepop [打印本页]

作者: dongdongdjh    时间: 2015-11-18 13:27
标题: Namepop
本帖最后由 dongdongdjh 于 2015-11-22 22:20 编辑

用来显示事件名称的插件,功能与VA的Namepop差不多,所以也就取名Namepop了。

插件效果图
插件设定方法图

Namepop Ver 1.03


Namepop.7z (750 Bytes, 下载次数: 779)


作者: dongdongdjh    时间: 2015-11-18 18:30
自己发现了一个bug,水晶的名字没法正常显示在顶上。暂时没想到怎么修复。
作者: dc1988123    时间: 2015-11-18 23:13
可以改图把水晶左右间隔改大,选取的时候只要选取区域是正方形就能正常显示了。
不过最大也估计只能用$BigMonster2那种120X120大小,再大点名字就上不去了。
作者: dongdongdjh    时间: 2015-11-19 08:27
dc1988123 发表于 2015-11-18 23:13
可以改图把水晶左右间隔改大,选取的时候只要选取区域是正方形就能正常显示了。
不过最大也估计只能用$BigM ...

水晶的话 不要显示事件名,然后在水晶的事件上面新建一个空图片事件,显示事件名
作者: dc1988123    时间: 2015-11-19 09:26
静止的水晶可以这样处理,如果会移动的话就很麻烦了,改图也麻烦,如果能实现(Namepop X Y)命名方式 实现X Y轴微调就好了。
作者: dc1988123    时间: 2015-11-19 10:20
我不懂脚本,不过可以提供一个思路,
this._namepopSprite.y = this.y - height * 48 ;  改成  this._namepopSprite.y = this.y - height * 48  + 设置一个变量 ;  
变量赋值为注释Namepop后面的数字,可为负数,不注释的话默认为0。实测显示任何图片上都没问题。
作者: dongdongdjh    时间: 2015-11-19 10:28
dc1988123 发表于 2015-11-19 10:20
我不懂脚本,不过可以提供一个思路,
this._namepopSprite.y = this.y - height * 48 ;  改成  this._namep ...

如你所愿
作者: 余烬之中    时间: 2015-11-19 10:33
本帖最后由 余烬之中 于 2015-11-19 11:30 编辑

JAVASCRIPT 代码复制
  1. (function() {
  2.   namepopplus_scpi = Sprite_Character.prototype.initialize;
  3.   Sprite_Character.prototype.initialize = function(character) {
  4.   namepopplus_scpi.call(this, character);
  5.   this._tempCharacter = character;
  6.   this._tempIsBigCharacter = ImageManager.isBigCharacter(character._characterName);
  7.   if (character instanceof Game_Event) {
  8.     matchreg = /namepop\s*(?:<\s*(\-)?(\d+)\s*,\s*(\-)?(\d+)\s*>)?/i;
  9.     matchres = character.event().note.match(matchreg);
  10.     if (matchres != null) {
  11.       xoffs = (matchres[1] === void 0 ? 1 : -1) * (matchres[2] || 0);
  12.       yoffs = (matchres[3] === void 0 ? 1 : -1) * (matchres[4] || 0);
  13.       this.createNamepopSet(xoffs, yoffs);
  14.     };
  15.   };
  16. };
  17.  
  18. Sprite_Character.prototype.createNamepopSet = function() {
  19.   var height = this._tempIsBigCharacter ? 2 : 1;
  20.   this._namepopSprite = new Sprite();
  21.   this._namepopSprite.bitmap = new Bitmap(100, 20);
  22.   this._namepopSprite.bitmap.fontSize = 18;
  23.   this._namepopSprite.bitmap.drawText(this._tempCharacter.event().name, 0, 0, 100, 20, 'center');
  24.   this._namepopSprite.anchor.x = 0.5;
  25.   this._namepopSprite.anchor.y = 1;
  26.   this._namepopSprite.x = this.x + arguments[0];
  27.   this._namepopSprite.y = this.y + arguments[1] - height * 48;
  28.   this.addChild(this._namepopSprite);
  29. };
  30.  
  31. }());

作者: dongdongdjh    时间: 2015-11-22 22:09
本帖最后由 余烬之中 于 2015-11-22 22:26 编辑

@余烬之中浴巾大美女 ,修改成这样 可以吗????????
作者: tseyik    时间: 2015-11-26 20:14
VA的Namepop也寫了個Namepop
TMNamePop
作者: 1181770261    时间: 2015-12-12 11:22
人物气球脚本和NAMEPOP并用食用效果更佳,修正值1.5

QQ截图20151212112407.png (15.81 KB, 下载次数: 10)

QQ截图20151212112407.png

作者: chaizi1992    时间: 2016-1-4 11:40
{:2_276:}这个脚本当这个NPC有时显示有时不显示时就崩了……只能给一些固定NPC使用
作者: salvareless    时间: 2016-1-13 22:56
求问怎么设置NPC头上显示的文字的颜色= =,mv里好像没有VA上的‘bitmap.font.color.set’这个方法。所以我写了半天还是弄不出来。
同一个方法,在va里是这样的
  1.   def create_bitmap
  2.     self.bitmap = Bitmap.new(96, 48)
  3.     self.bitmap.font.size = 32
  4.     self.bitmap.font.color.set(255, 255, 255)
  5.   end
复制代码
而在mv里面是这样的
  1. Sprite_Timer.prototype.createBitmap = function() {
  2.     this.bitmap = new Bitmap(96, 48);
  3.     this.bitmap.fontSize = 32;
  4. };
复制代码
求问各路大神,这要怎么样给事件头上的问题规定颜色啊= =我想做有点事件显示为蓝色名字,而有的是红色或者黄色。我之前VA上市定义了另外两个和namepop(namepvp和namepcp)一样的注释来实现的。现在MV这个颜色那句怎么写怎么错,无奈了已经,求各路大神解答一下。
作者: xzyujixun    时间: 2017-9-28 20:34
xiexiexiexiexiexiexiexiexiexiexiexiexiexiexiexie




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1