| 赞 | 56 |
| VIP | |
| 好人卡 | |
| 积分 | 37 |
| 经验 | |
| 最后登录 | 2025-9-3 |
| 在线时间 | 4468 小时 |
- 梦石
- 0
- 星屑
- 3677
- 在线时间
- 4468 小时
- 注册时间
- 2008-6-12
- 回帖
- 776
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 过眼云烟 于 2015-11-17 08:52 编辑
最近在学习js,尝试用js写自己需要的插件。
地图人物阴影插件是在RMMV游戏中非战斗界面下显示人物影子,默认情况下主角和队列都会显示影子,地图事件名中含有Sh则显示影子。
如果有问题欢迎留言。
效果如下:
效果图
[pre lang="js" file="MrLiu_Shadow.js"]//=============================================================================
// MrLiu_Shadow.js
//=============================================================================
/*:
* Version: 2015-11-17-0001
* @plugindesc 在RMMV游戏中非战斗界面下显示人物影子,
* @help 使用方法:
* 默认情况下主角和队列都会显示影子,地图事件名中含有Sh则显示影子。
* @author 过眼云烟
*/
var Imported = Imported || {};
Imported.MrLiu_Shadow = true;
var Lmd = Lmd || {};
Lmd.MrLiu_Shadow = Lmd.MrLiu_Shadow || {};
Lmd.MrLiu_Shadow.Sprite_Character_initialize = Sprite_Character.prototype.initialize;
Sprite_Character.prototype.initialize = function(character) {
Lmd.MrLiu_Shadow.Sprite_Character_initialize.call(this,character);
this._temperycharacter = character;
if ((character instanceof Game_Player)||(character instanceof Game_Follower)){
this.createShadowSet();
this._showShadow = true;
}
if ((character instanceof Game_Event) && (character.event().name.indexOf("Sh")>=0)){
this.createShadowSet();
this._showShadow = true;
}
};
Sprite_Character.prototype.createShadowSet = function() {
this._shadowSprite = new Sprite();
this._shadowSprite.bitmap = ImageManager.loadSystem('Shadow1');
this._shadowSprite.x = this.x;
this._shadowSprite.y = this.y +8;
this._shadowSprite.anchor.x = 0.5;
this._shadowSprite.anchor.y = 1;
this._shadowSprite.z = -1;
this.addChild(this._shadowSprite);
}
Sprite_Character.prototype.update_character_shadow = function() {
this._shadowSprite.scale.x = ((this.patternWidth() * 100) / 48) / 90.0;
this._shadowSprite.scale.y = this._shadowSprite.scale.x;
this._shadowSprite.opacity = 150;
this._shadowSprite.visible = (this._characterName != "");
if (this._lastone != this._shadowx){
this._lastone = this._shadowx;
console.log(this._shadowx);
}
}
Lmd.MrLiu_Shadow.Sprite_Character_update = Sprite_Character.prototype.update;
Sprite_Character.prototype.update = function() {
Lmd.MrLiu_Shadow.Sprite_Character_update.call(this);
if (this._showShadow == true) {
this.update_character_shadow();
}
}
[/pre] |
评分
-
查看全部评分
|