i think there's a plugin created by japanese author (Yoji Ojima) called ButtonPicture.js
that can bind any show picture id to common event. i forgot where i got it... either from:
MZ launch plugin release, MZ DLC, or MZ sample game... you can try looking at the MZ newdata folder (you could also create new project and see if there's plugin copied to your new project plugin folder)
it's this plugin
ピクチャをクリック可能にします。
plugin-mz.fungamemake.com
but i did not see any download button >.<. and the website japanese T.T
here's the code in case you cannot find it... don't forget to credit Yoji Ojima
Spoiler
Code:
//=============================================================================
// RPG Maker MZ - Button Picture
//=============================================================================
/*:
* @target MZ
* @plugindesc Makes a picture clickable.
* @author Yoji Ojima
*
* @help ButtonPicture.js
*
* This plugin provides a command to call a common event when a picture is
* clicked.
*
* Use it in the following procedure.
* 1. Execute "Show Picture" to display your button image.
* 2. Call the plugin command "Set Button Picture".
*
* @command set
* @text Set Button Picture
* @desc Makes the specified picture clickable.
*
* @arg pictureId
* @type number
* @min 1
* @max 100
* @default 1
* @text Picture Number
* @desc Control number of the picture.
*
* @arg commonEventId
* @type common_event
* @default 1
* @text Common Event
* @desc Common event to call when the picture is clicked.
*/
/*:ja
* @target MZ
* @plugindesc ピクチャをクリック可能にします。
* @author Yoji Ojima
*
* @help ButtonPicture.js
*
* このプラグインは、ピクチャのクリック時にコモンイベントを呼び出すコマンドを
* 提供します。
*
* 次の手順で使用してください。
* 1. 「ピクチャの表示」を実行して、ボタン画像を表示します。
* 2. プラグインコマンド「ボタンピクチャの設定」を呼び出します。
*
* @command set
* @text ボタンピクチャの設定
* @desc 指定したピクチャをクリック可能にします。
*
* @arg pictureId
* @type number
* @min 1
* @max 100
* @default 1
* @text ピクチャ番号
* @desc ピクチャの管理番号です。
*
* @arg commonEventId
* @type common_event
* @default 1
* @text コモンイベント
* @desc ピクチャがクリックされた時に呼び出すコモンイベントです。
*/
(() => {
const pluginName = "ButtonPicture";
PluginManager.registerCommand(pluginName, "set", args => {
const pictureId = Number(args.pictureId);
const commonEventId = Number(args.commonEventId);
const picture = $gameScreen.picture(pictureId);
if (picture) {
picture.mzkp_commonEventId = commonEventId;
}
});
Sprite_Picture.prototype.isClickEnabled = function() {
const picture = this.picture();
return picture && picture.mzkp_commonEventId && !$gameMessage.isBusy();
};
Sprite_Picture.prototype.onClick = function() {
$gameTemp.reserveCommonEvent(this.picture().mzkp_commonEventId);
};
Spriteset_Base.prototype.mzkp_isAnyPicturePressed = function() {
return this._pictureContainer.children.some(sprite =>
sprite.isPressed()
);
};
const _Scene_Map_isAnyButtonPressed =
Scene_Map.prototype.isAnyButtonPressed;
Scene_Map.prototype.isAnyButtonPressed = function() {
return (
_Scene_Map_isAnyButtonPressed.apply(this, arguments) ||
this._spriteset.mzkp_isAnyPicturePressed()
);
};
})();
make sure you name the file ButtonPicture.js
that plugin did not support :hover or :activestates though...
but that plugin can be modified because Sprite_Picture inherit from
Sprite_Clickable and thus have these methods....
Spoiler
Code:
Sprite_Clickable.prototype.onMouseEnter = function() {
//
};
Sprite_Clickable.prototype.onMouseExit = function() {
//
};
Sprite_Clickable.prototype.onPress = function() {
//
};
Sprite_Clickable.prototype.onClick = function() {
//
};
you can expand above plugin to use above methods
hope this help