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,501
Reaction score
727
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
8,465
Reaction score
5,591
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.

 

Latest Threads

Latest Posts

Latest Profile Posts

Is there any way to get more than 8 enemies in a troop in RMMV or is that limit pretty much hardcoded into the engine?
Stream will be live shortly with some game development! Feel free to drop by!
Finally working actively on Tundra! I'd like to share my wife's WIP art for the starting map and a rough draft of one of the later characters, Katrina. She's very eager to hear any feedback you might have!1623790662347.png
Got my first vax today, arm is a bit numb, but nothing odd so far. :kaopride:
dYOm9IY.jpg
image_2021-06-15_212613.png
Looks a bit.....kid friendly. Then again, I suppose that does with with a lot of retro themes... Crap, already spotted a flaw xD

Forum statistics

Threads
112,266
Messages
1,066,942
Members
145,882
Latest member
Vincentus
Top