Skip to content

Instantly share code, notes, and snippets.

View triacontane's full-sized avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / SpriteWeaponPriority.js
Created April 11, 2021 09:03
武器スプライトをアクターの前面に表示
(()=> {
'use strict';
const _Sprite_Actor_createMainSprite = Sprite_Actor.prototype.createMainSprite;
Sprite_Actor.prototype.createMainSprite = function() {
_Sprite_Actor_createMainSprite.apply(this, arguments);
this.addChild(this._weaponSprite);
};
})();
//https://note.affi-sapo-sv.com//js-canvas-how-use.php
/*:ja
* @plugindesc 円グラフまたは折れ線グラフ
* @author
*
* @help
* 【プラグインコマンド】
* PIE_GRAPH [グラフ番号] [中心座標X] [中心座標Y] [グラフ幅] [グラフ高さ] [グラフデータ変数] [ラベルデータ変数] [色データ変数]
* 円グラフ [グラフ番号] [中心座標X] [中心座標Y] [グラフ幅] [グラフ高さ] [グラフデータ変数] [ラベルデータ変数] [色データ変数]
var _Window_SavefileList_itemRect = Window_SavefileList.prototype.itemRect;
Window_SavefileList.prototype.itemRect = function(index) {
var rect = _Window_SavefileList_itemRect.apply(this, arguments);
rect.height -= 100;
return rect;
};
var _Window_SavefileList_itemHeight = Window_SavefileList.prototype.itemHeight;
Window_SavefileList.prototype.itemHeight = function() {
return _Window_SavefileList_itemHeight.apply(this, arguments) + 100;
@triacontane
triacontane / padSpace.js
Created February 21, 2021 05:55
数値を指定桁数で半角スペース埋めします。
(function() {
'use strict';
Number.prototype.padSpace = function(length){
return String(this).padSpace(length);
};
String.prototype.padSpace = function(length){
var s = this;
while (s.length < length) {
s = ' ' + s;
@triacontane
triacontane / bltSample.js
Created January 30, 2021 08:35
キャッシュされていないbitmapをbltするサンプル
var bitmap = ImageManager.loadFace(faceName);
bitmap.addLoadListener(function() {
this.contents.blt(bitmap, 0, 0, 0, 0, 0, 0);
}.bind(this));
@triacontane
triacontane / parameterSe.js
Last active January 19, 2021 15:42
プラグインパラメータで使用するSEのstruct
/*~struct~SE:
*
* @param name
* @text ファイル名
* @desc ファイル名です。
* @require 1
* @dir audio/se/
* @type file
* @default
*
@triacontane
triacontane / AddKeyCode.js
Created January 14, 2021 14:50
指定したキーコードをボタン名に追加
(function() {
'use strict';
Input.keyMapper[65] = 'A'; // key code [A]
})();
@triacontane
triacontane / CallInterpreterMethod.js
Created November 5, 2020 11:49
プラグインコマンドでGame_Interpreterのメソッドを呼ぶ
/*:
* @plugindesc CallInterpreterMethod
* @target MZ
*
* @command COMMAND_SAMPLE
* @text コマンド名称
* @desc コマンドの説明
*
* This plugin is released under the MIT License.
*/
@triacontane
triacontane / horizontalArrow.js
Created May 23, 2020 03:10
ウィンドウのページ送りの矢印を横向きにする
Window_AudioCategory.prototype._refreshArrows = function() {
Window.prototype._refreshArrows.call(this);
var w = this._width;
var h = this._height;
var p = 24;
var q = p / 2;
this._downArrowSprite.rotation = 270 * Math.PI / 180;
this._downArrowSprite.move(w - q, h / 2);
this._upArrowSprite.rotation = 270 * Math.PI / 180;
@triacontane
triacontane / NoStepInputting.js
Last active May 19, 2020 16:07
入力中のサイドビューアクターの前進処理を無効にします。
(function() {
'use strict';
Sprite_Actor.prototype.stepForward = function() {};
})();