查看: 15437|回复: 14

[原创发布] Namepop

[复制链接]
梦石
0
星屑
4058
在线时间
836 小时
注册时间
2013-7-29
回帖
145

开拓者

发表于 2015-11-18 13:27:06 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 dongdongdjh 于 2015-11-22 22:20 编辑

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

[fold=插件效果图] QQ图片20151122214320.png [/fold]
[fold=插件设定方法图]
QQ图片20151122214334.png

QQ图片20151122214347.png

QQ图片20151122214359.png

QQ图片20151122214410.png
[/fold]

[fold=Namepop Ver 1.03]对插件再次修改,因为名字一般都显示在中间位置,所以取消了X轴的修正,加入了字体Size的设定。

[pre lang="JavaScript"]/*:
* @plugindesc Namepop Ver 1.03
* @author Morpho(dongdongDJH)
*
* @help
* 在地图事件注释栏内填入 NAMEPOP|高度修正值|字体Size;
* 高度修正值单位为1格,不填默认为1,字体大小不填默认为18;
* 例:NAMEPOP|2|19 ; NAMEPOP||20 ; 注:一定要用‘|’分隔高度修正值和字体Size;
*/
(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);
        };
}());[/pre]
[/fold]

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

点评

ok 收录  发表于 2015-11-22 22:21
好的 现在手上没电脑 回家后我修改下  发表于 2015-11-22 15:37
编辑主楼 把图片用折叠框折起来 并且把脚本稍微修饰一下更新到主楼 然后我就给你加进图书馆去  发表于 2015-11-22 12:21

评分

参与人数 2星屑 +166 梦石 +2 赞 +1 收起 理由
yueshiguili112 + 1 精品文章
余烬之中 + 166 + 2 图书馆收录

查看全部评分

现在论坛上的少,有事联系
QQ:2287688663
梦石
0
星屑
4058
在线时间
836 小时
注册时间
2013-7-29
回帖
145

开拓者

 楼主| 发表于 2015-11-18 18:30:32 | 显示全部楼层
自己发现了一个bug,水晶的名字没法正常显示在顶上。暂时没想到怎么修复。
现在论坛上的少,有事联系
QQ:2287688663
回复

使用道具 举报

梦石
0
星屑
70
在线时间
269 小时
注册时间
2015-9-6
回帖
82
发表于 2015-11-18 23:13:59 | 显示全部楼层
可以改图把水晶左右间隔改大,选取的时候只要选取区域是正方形就能正常显示了。
不过最大也估计只能用$BigMonster2那种120X120大小,再大点名字就上不去了。
回复

使用道具 举报

梦石
0
星屑
4058
在线时间
836 小时
注册时间
2013-7-29
回帖
145

开拓者

 楼主| 发表于 2015-11-19 08:27:29 | 显示全部楼层
dc1988123 发表于 2015-11-18 23:13
可以改图把水晶左右间隔改大,选取的时候只要选取区域是正方形就能正常显示了。
不过最大也估计只能用$BigM ...

水晶的话 不要显示事件名,然后在水晶的事件上面新建一个空图片事件,显示事件名
现在论坛上的少,有事联系
QQ:2287688663
回复

使用道具 举报

梦石
0
星屑
70
在线时间
269 小时
注册时间
2015-9-6
回帖
82
发表于 2015-11-19 09:26:00 | 显示全部楼层
静止的水晶可以这样处理,如果会移动的话就很麻烦了,改图也麻烦,如果能实现(Namepop X Y)命名方式 实现X Y轴微调就好了。
回复

使用道具 举报

梦石
0
星屑
70
在线时间
269 小时
注册时间
2015-9-6
回帖
82
发表于 2015-11-19 10:20:05 | 显示全部楼层
我不懂脚本,不过可以提供一个思路,
this._namepopSprite.y = this.y - height * 48 ;  改成  this._namepopSprite.y = this.y - height * 48  + 设置一个变量 ;  
变量赋值为注释Namepop后面的数字,可为负数,不注释的话默认为0。实测显示任何图片上都没问题。

点评

思路是正确的 少年你很有前途 脚本不难 尝试开始学习吧  发表于 2015-11-19 10:36

评分

参与人数 1星屑 +66 收起 理由
余烬之中 + 66

查看全部评分

回复

使用道具 举报

梦石
0
星屑
4058
在线时间
836 小时
注册时间
2013-7-29
回帖
145

开拓者

 楼主| 发表于 2015-11-19 10:28:47 | 显示全部楼层
dc1988123 发表于 2015-11-19 10:20
我不懂脚本,不过可以提供一个思路,
this._namepopSprite.y = this.y - height * 48 ;  改成  this._namep ...

如你所愿
现在论坛上的少,有事联系
QQ:2287688663
回复

使用道具 举报

百合控

梦石
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]

点评

干脆丢掉直接从p3自己封吧 233 越看MV的代码也不顺眼。。。ORZ  发表于 2015-11-19 23:26
目前还在吃JGSS 虽然是ruby化的js但是还是得花时间消化一下  发表于 2015-11-19 13:22
卧槽我今天正打算开始动工  发表于 2015-11-19 13:21
你的书籍脚本准备什么时候转成MV的  发表于 2015-11-19 12:34
已修改  发表于 2015-11-19 11:31
萌新瑟瑟发抖
看到我请叫我去干活
回复

使用道具 举报

梦石
0
星屑
4058
在线时间
836 小时
注册时间
2013-7-29
回帖
145

开拓者

 楼主| 发表于 2015-11-22 22:09:15 | 显示全部楼层
本帖最后由 余烬之中 于 2015-11-22 22:26 编辑

@余烬之中 , 浴巾大美女 ,修改成这样 可以吗????????

点评

我不是美女 VA区那个比较懒的版主才是美女 b_b  发表于 2015-11-22 22:26
现在论坛上的少,有事联系
QQ:2287688663
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-11-26 20:14:01 | 显示全部楼层
VA的Namepop也寫了個Namepop
TMNamePop
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部