|
原地址:【RPGツクールMZ・MV】ノベルゲーム風改行カーソルプラグイン | ルルの教会 (nine-yusha.com)
预览:
MZ 脚本:
- //=============================================================================
- // RPGツクールMZ - LL_GalgePauseSign.js v1.0.2
- //-----------------------------------------------------------------------------
- // ルルの教会 (Lulu's Church)
- // https://nine-yusha.com/
- //
- // URL below for license details.
- // https://nine-yusha.com/plugin/
- //=============================================================================
- /*:
- * @target MZ
- * @plugindesc 视觉小说风格文章继续图标
- * 汉化 by 烁灵 更多脚本请访问 www.hknmtt.com
- * @author ルルの教会
- * @url https://nine-yusha.com/plugin-galgepausesign/
- *
- * @help LL_GalgePauseSign.js
- *
- * 展示视觉小说风格的文章继续图标
- * 只需要 1 张继续图标图片
- * 不需要为动画准备图片
- *
- * 没有插件指令
- *
- * 利用規約:
- * ・著作権表記は必要ございません。
- * ・利用するにあたり報告の必要は特にございません。
- * ・商用・非商用問いません。
- * ・R18作品にも使用制限はありません。
- * ・ゲームに合わせて自由に改変していただいて問題ございません。
- * ・プラグイン素材としての再配布(改変後含む)は禁止させていただきます。
- *
- * 作者: ルルの教会
- * 作成日: 2021/8/15
- *
- * @param imageName
- * @text 图片文件名
- * @desc 文章继续图标的文件名,放在 img/system 文件夹
- * 推荐使用 24px~36px 的正方形尺寸
- * @dir img/system
- * @type file
- * @require 1
- *
- * @param animation
- * @text 动画
- * @desc 图标动画
- * @type select
- * @default vertical
- * @option 无
- * @value none
- * @option 上下移动
- * @value vertical
- * @option 左右移动
- * @value horizontal
- * @option 闪烁
- * @value blinking
- * @option 放大缩小
- * @value zoom
- * @option 旋转
- * @value rotation
- * @option 跳跃
- * @value jumping
- * @option 流星
- * @value shootingstar
- *
- * @param positionType
- * @text 位置类型
- * @desc 图标位置设置
- * @type select
- * @default centerBottom
- * @option 左下
- * @value leftBottom
- * @option 中心
- * @value centerBottom
- * @option 右下
- * @value rightBottom
- * @option 文章末尾
- * @value textEnd
- *
- * @param positionX
- * @text X 坐标
- * @desc X 坐标偏移值。(初始: 0)
- * 正数向右移动,负数向左移动
- * @default 0
- * @min -2000
- * @max 2000
- * @type number
- *
- * @param positionY
- * @text Y坐标
- * @desc Y 坐标偏移值。(初始: 0)
- * 正数向下移动,负数向上移动
- * @default 0
- * @min -2000
- * @max 2000
- * @type number
- */
- (() => {
- "use strict";
- const pluginName = "LL_GalgePauseSign";
- const parameters = PluginManager.parameters(pluginName);
- const animation = String(parameters["animation"] || "vertical");
- const imageName = String(parameters["imageName"] || "");
- const positionType = String(parameters["positionType"] || "centerBottom");
- const positionX = Number(parameters["positionX"] || 0);
- const positionY = Number(parameters["positionY"] || 0);
- const _Window_Message_startPause = Window_Message.prototype.startPause;
- Window_Message.prototype.startPause = function() {
- _Window_Message_startPause.apply(this, arguments);
- this._refreshPauseSign();
- };
- Window_Message.prototype._refreshPauseSign = function() {
- const sx = 144;
- const sy = 96;
- const p = 24;
- // カーソル画像読み込み
- if (imageName) {
- this._pauseSignSprite.bitmap = ImageManager.loadSystem(imageName);
- } else {
- this._pauseSignSprite.bitmap = this._windowskin;
- // MZのみカーソル画像の上部に謎の見切れ線?が入るので、縦を1px縮小
- // this._pauseSignSprite.setFrame(sx, sy, p, p);
- this._pauseSignSprite.setFrame(sx, sy + 1, p, p - 1);
- }
- this._pauseSignSprite.anchor.x = 0.5;
- this._pauseSignSprite.anchor.y = 0.5;
- // 画像が読み込まれたあとに実行
- this._pauseSignSprite.bitmap.addLoadListener(function() {
- switch (positionType) {
- case "leftBottom":
- this._pauseSignSprite.move((this._pauseSignSprite.width / 2) + positionX + this.padding, this._height - (this._pauseSignSprite.height / 2) + positionY - (this.padding / 2));
- break;
- case "centerBottom":
- this._pauseSignSprite.move((this._width / 2) + positionX, this._height - (this._pauseSignSprite.height / 2) + positionY);
- break;
- case "rightBottom":
- this._pauseSignSprite.move(this._width - (this._pauseSignSprite.width / 2) + positionX - this.padding, this._height - (this._pauseSignSprite.height / 2) + positionY - (this.padding / 2));
- break;
- case "textEnd":
- if (this._textState) {
- let textStateCalcY = this._textState.outputHeight - this._textState.height + this._textState.height;
- if (textStateCalcY < this._textState.height) textStateCalcY = this._textState.height;
- this._pauseSignSprite.move(this._textState.x + (this._pauseSignSprite.width / 2) + this.padding + positionX, textStateCalcY + positionY);
- } else {
- this._pauseSignSprite.move((this._width / 2) + positionX, this._height - (this._pauseSignSprite.height / 2) + positionY - (this.padding / 2));
- }
- break;
- }
- }.bind(this));
- this._pauseSignSprite.alpha = 0;
- this._pauseSignSprite.animationCount = 0;
- };
- Window_Message.prototype._updatePauseSign = function() {
- const sprite = this._pauseSignSprite;
- if (!this.pause) {
- sprite.alpha = 0;
- }
- sprite.visible = this.isOpen();
- };
- const _Window_Message_update = Window_Message.prototype.update;
- Window_Message.prototype.update = function() {
- _Window_Message_update.apply(this, arguments);
- // カーソルアニメーション
- if (this.pause && this._pauseSignSprite) {
- this._animationPauseSign();
- }
- };
- Window_Message.prototype._animationPauseSign = function() {
- const sprite = this._pauseSignSprite;
- switch (animation) {
- case "vertical": // 上下
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.y += 0.25;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.y -= 0.25;
- sprite.animationCount += 1;
- } else if (this._pauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "horizontal": // 左右
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.x += 0.25;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.x -= 0.25;
- sprite.animationCount += 1;
- } else if (this._pauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "blinking": // 点滅
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.opacity -= 255 / 30;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.opacity += 255 / 30;
- sprite.animationCount += 1;
- } else if (this._pauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "zoom": // ズーム
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.scale.x = 1;
- sprite.scale.y = 1;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.scale.x += 0.5 / 30;
- sprite.scale.y += 0.5 / 30;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.scale.x -= 0.5 / 30;
- sprite.scale.y -= 0.5 / 30;
- sprite.animationCount += 1;
- } else if (this._pauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "rotation": // 回転
- sprite.opacity = 255;
- sprite.rotation += 1 / 30;
- break;
- case "jumping": // ジャンプ
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 16) {
- sprite.y -= 0.5;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.y += 0.5;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.animationCount += 1;
- } else if (this._pauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "shootingstar": // 流れ星
- if (sprite.animationCount === 0) {
- sprite.scale.x = 0;
- sprite.scale.y = 0;
- sprite.rotation = 1.5;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.opacity = 255;
- sprite.scale.x += 1 / 30;
- sprite.scale.y += 1 / 30;
- sprite.rotation -= 1.5 / 30;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.opacity -= 10;
- sprite.animationCount += 1;
- } else if (this._pauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- default:
- sprite.opacity = 255;
- }
- };
- })();
复制代码
MV 脚本:
- //=============================================================================
- // RPGツクールMV - LL_GalgePauseSignMV.js v1.0.2
- //-----------------------------------------------------------------------------
- // ルルの教会 (Lulu's Church)
- // https://nine-yusha.com/
- //
- // URL below for license details.
- // https://nine-yusha.com/plugin/
- //=============================================================================
- /*:
- * @target MV
- * @plugindesc 视觉小说风格文章继续图标
- * 汉化 by 烁灵 更多脚本请访问 www.hknmtt.com
- * @author ルルの教会
- * @url https://nine-yusha.com/plugin-galgepausesign/
- *
- * @help LL_GalgePauseSignMV.js
- *
- * 展示视觉小说风格的文章继续图标
- * 只需要 1 张继续图标图片
- * 不需要为动画准备图片
- *
- * 没有插件指令
- *
- * 利用規約:
- * ・著作権表記は必要ございません。
- * ・利用するにあたり報告の必要は特にございません。
- * ・商用・非商用問いません。
- * ・R18作品にも使用制限はありません。
- * ・ゲームに合わせて自由に改変していただいて問題ございません。
- * ・プラグイン素材としての再配布(改変後含む)は禁止させていただきます。
- *
- * 作者: ルルの教会
- * 作成日: 2021/8/15
- *
- * @param imageName
- * @text 图片文件名
- * @desc 文章继续图标的文件名,放在 img/system 文件夹
- * 推荐使用 24px~36px 的正方形尺寸
- * @dir img/system
- * @type file
- * @require 1
- *
- * @param animation
- * @text 动画
- * @desc 图标动画
- * @type select
- * @default vertical
- * @option 无
- * @value none
- * @option 上下移动
- * @value vertical
- * @option 左右移动
- * @value horizontal
- * @option 闪烁
- * @value blinking
- * @option 放大缩小
- * @value zoom
- * @option 旋转
- * @value rotation
- * @option 跳跃
- * @value jumping
- * @option 流星
- * @value shootingstar
- *
- * @param positionType
- * @text 位置类型
- * @desc 图标位置设置
- * @type select
- * @default centerBottom
- * @option 左下
- * @value leftBottom
- * @option 中心
- * @value centerBottom
- * @option 右下
- * @value rightBottom
- * @option 文章末尾
- * @value textEnd
- *
- * @param positionX
- * @text X 坐标
- * @desc X 坐标偏移值。(初始: 0)
- * 正数向右移动,负数向左移动
- * @default 0
- * @min -2000
- * @max 2000
- * @type number
- *
- * @param positionY
- * @text Y坐标
- * @desc Y 坐标偏移值。(初始: 0)
- * 正数向下移动,负数向上移动
- * @default 0
- * @min -2000
- * @max 2000
- * @type number
- */
- (function() {
- "use strict";
- var pluginName = "LL_GalgePauseSignMV";
- var parameters = PluginManager.parameters(pluginName);
- var animation = String(parameters["animation"] || "vertical");
- var imageName = String(parameters["imageName"] || "");
- var positionType = String(parameters["positionType"] || "centerBottom");
- var positionX = Number(parameters["positionX"] || 0);
- var positionY = Number(parameters["positionY"] || 0);
- var _Window_Message_startPause = Window_Message.prototype.startPause;
- Window_Message.prototype.startPause = function() {
- _Window_Message_startPause.apply(this, arguments);
- this._refreshPauseSign();
- };
- Window_Message.prototype._refreshPauseSign = function() {
- var sx = 144;
- var sy = 96;
- var p = 24;
- // カーソル画像読み込み
- if (imageName) {
- this._windowPauseSignSprite.bitmap = ImageManager.loadSystem(imageName);
- } else {
- this._windowPauseSignSprite.bitmap = this._windowskin;
- this._windowPauseSignSprite.setFrame(sx, sy, p, p);
- }
- this._windowPauseSignSprite.anchor.x = 0.5;
- this._windowPauseSignSprite.anchor.y = 0.5;
- // 画像が読み込まれたあとに実行
- this._windowPauseSignSprite.bitmap.addLoadListener(function() {
- switch (positionType) {
- case "leftBottom":
- this._windowPauseSignSprite.move((this._windowPauseSignSprite.width / 2) + positionX + this.padding, this._height - (this._windowPauseSignSprite.height / 2) + positionY - (this.padding / 2));
- break;
- case "centerBottom":
- this._windowPauseSignSprite.move((this._width / 2) + positionX, this._height - (this._windowPauseSignSprite.height / 2) + positionY);
- break;
- case "rightBottom":
- this._windowPauseSignSprite.move(this._width - (this._windowPauseSignSprite.width / 2) + positionX - this.padding, this._height - (this._windowPauseSignSprite.height / 2) + positionY - (this.padding / 2));
- break;
- case "textEnd":
- if (this._textState) {
- var textStateCalcY = this._textState.outputHeight - this._textState.height + this._textState.height;
- if (textStateCalcY < this._textState.height) textStateCalcY = this._textState.height;
- this._windowPauseSignSprite.move(this._textState.x + (this._windowPauseSignSprite.width / 2) + this.padding + positionX, textStateCalcY + positionY);
- } else {
- this._windowPauseSignSprite.move((this._width / 2) + positionX, this._height - (this._windowPauseSignSprite.height / 2) + positionY);
- }
- break;
- }
- }.bind(this));
- this._windowPauseSignSprite.alpha = 0;
- this._windowPauseSignSprite.animationCount = 0;
- };
- Window_Message.prototype._updatePauseSign = function() {
- var sprite = this._windowPauseSignSprite;
- if (!this.pause) {
- sprite.alpha = 0;
- }
- sprite.visible = this.isOpen();
- };
- var _Window_Message_update = Window_Message.prototype.update;
- Window_Message.prototype.update = function() {
- _Window_Message_update.apply(this, arguments);
- // カーソルアニメーション
- if (this.pause && this._windowPauseSignSprite) {
- this._animationPauseSign();
- }
- };
- Window_Message.prototype._animationPauseSign = function() {
- var sprite = this._windowPauseSignSprite;
- switch (animation) {
- case "vertical": // 上下
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.y += 0.25;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.y -= 0.25;
- sprite.animationCount += 1;
- } else if (this._windowPauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "horizontal": // 左右
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.x += 0.25;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.x -= 0.25;
- sprite.animationCount += 1;
- } else if (this._windowPauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "blinking": // 点滅
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.opacity -= 255 / 30;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.opacity += 255 / 30;
- sprite.animationCount += 1;
- } else if (this._windowPauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "zoom": // ズーム
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.scale.x = 1;
- sprite.scale.y = 1;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.scale.x += 0.5 / 30;
- sprite.scale.y += 0.5 / 30;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.scale.x -= 0.5 / 30;
- sprite.scale.y -= 0.5 / 30;
- sprite.animationCount += 1;
- } else if (this._windowPauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "rotation": // 回転
- sprite.opacity = 255;
- sprite.rotation += 1 / 30;
- break;
- case "jumping": // ジャンプ
- if (sprite.animationCount === 0) {
- sprite.opacity = 255;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 16) {
- sprite.y -= 0.5;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.y += 0.5;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.animationCount += 1;
- } else if (this._windowPauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- case "shootingstar": // 流れ星
- if (sprite.animationCount === 0) {
- sprite.scale.x = 0;
- sprite.scale.y = 0;
- sprite.rotation = 1.5;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 31) {
- sprite.opacity = 255;
- sprite.scale.x += 1 / 30;
- sprite.scale.y += 1 / 30;
- sprite.rotation -= 1.5 / 30;
- sprite.animationCount += 1;
- } else if (sprite.animationCount < 61) {
- sprite.opacity -= 10;
- sprite.animationCount += 1;
- } else if (this._windowPauseSignSprite.animationCount === 61) {
- sprite.animationCount = 0;
- }
- break;
- default:
- sprite.opacity = 255;
- }
- };
- // for MV
- var _Window_Message_startMessage = Window_Message.prototype.startMessage;
- Window_Message.prototype.startMessage = function() {
- _Window_Message_startMessage.apply(this, arguments);
- // textStateにstartYとoutputHeightを追加
- this._textState.startY = this._textState.y;
- this._textState.outputHeight = 0;
- };
- var _Window_Message_processCharacter = Window_Message.prototype.processCharacter;
- Window_Message.prototype.processCharacter = function(textState) {
- this._textState.outputHeight = textState.y - textState.startY + textState.height;
- _Window_Message_processCharacter.apply(this, arguments, textState);
- };
- })();
复制代码
|
|