RMMZ [on-screen controls wanted] Best -not paid system for on-screen custom controls

PaganoCristo

Warper
Member
Joined
Oct 20, 2020
Messages
4
Reaction score
1
First Language
Italian
Primarily Uses
RMMZ
Hello, I am a new RPGmaker MZ user with basic JS knowledge for web design.

I'm looking for a way to implement a simple custom on-screen button or more (with its relative keyboard input) for some of the game scenes. I'd need it to perform simple tasks as running a common event, maybe supporting :hover and :active states, having in general the vanilla UI feel.
With that said, I see that VisualStella has picture control events and Picture Common Events that would certainly fit my needs but, since I'm just starting investigating the viability of this project of mine, I'm avoiding paid and extensive plugins for now.

Is there a good free plugin i could use?
Is there any native RPGmaker capability I'm not aware of to script it myself with JS?
Any other veteran recommendations?
Thank you all.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,286
Reaction score
513
First Language
indonesian
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
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
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....
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
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,818
Reaction score
5,213
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Evil7 added!


I did a bit of a remake on one of the maps, also I made a particle for jumping into the portal, and one for traveling through the portal. I'll probably add more sparkles later to embellish it. :LZSwink:
Polished the animation and added details :kaojoy:
Ami
What do you think about the Wood Bridge inside of Volcano?
Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.

Forum statistics

Threads
105,686
Messages
1,015,538
Members
137,362
Latest member
sdramose
Top