Skip to content

Instantly share code, notes, and snippets.

@KageDesu
Last active June 28, 2025 14:31
Show Gist options
  • Save KageDesu/9a1b9545adca46377665a063d143d26c to your computer and use it in GitHub Desktop.
Save KageDesu/9a1b9545adca46377665a063d143d26c to your computer and use it in GitHub Desktop.
Mobile Controls Plugin Guide

Mobile Controls Plugin Guide

Author: Pheonix KageDesu
RPG Maker Versions: MZ, MV
URL: https://kdworkshop.net/plugins/mobile-controls


📱 Overview

This plugin adds simple mobile controls for RPG Maker games:

  • Joystick for movement

joystick2

  • Custom screen buttons for calling common events

switchbutton


🧩 Script Calls for Buttons

Use these in the Script Call On Click setting for a button:

PKD_MobileControls.simulateAction();   // Simulates Enter key press  
PKD_MobileControls.simulateCancel();   // Simulates Esc key press  
PKD_MobileControls.simulateJump();     // Simulates a 1-tile forward jump

✅ Button Press Conditions

Check if a button is currently pressed:

IsMCButtonIsPressed(INDEX);

Returns TRUE if the button with the specified INDEX is being pressed.


🧩 Common Script Calls

Show/Hide Joystick and all Buttons

PKD_MobileControls.HideAll();  // Hides joystick and all buttons
PKD_MobileControls.ShowAll();  // Shows joystick and all buttons

🖼️ Scene Visibility Filters

You can control the visibility of mobile controls elements based on the current scene. You can create buttons that are only visible in specific scenes, like the game menu or battle screen.

buttonOnAnyScene

How to Set Scene Visibility

Edit parameter Scenes Visibility Filter, you will find it inside the buttons and joystick parameters.

filterSettings

Note: By default, all elements are visible only on the map scene. You can set visibility for certain scenes or for all scenes except certain scenes.

  • Set Visible on Other Scenes? to true to make the element visible in all scenes except those specified in the Visible except in Scenes.

  • Or set Visible on Other Scenes? to true and specify the scenes names where the element should be visible in the Visible only in Scenes parameter.

2025-06-28_17-00-44

How get the current scene name?

Open the console in your browser (F12 or F8) and type:

SceneManager._scene.constructor.name

sceneNameExample


🔧 Plugin Commands

RPG Maker MV

Use the following format:

MC Joystick COMMAND
MC Button INDEX COMMAND
  • COMMAND: enable, disable, hide, show
  • INDEX: The button index (starting from 1) as defined in the plugin parameters

Examples:

MC Joystick hide
MC Button 1 disable

RPG Maker MZ

MZ provides Plugin Commands for controlling joystick and buttons. You can show/hide or enable/disable them during gameplay.


❓ Quick Question Window

QuickQestionWindow

Description

A custom question window that:

  • Displays an optional question

  • Has two buttons only:

    • First: Always confirms (OK)
    • Second: Always cancels
  • ⚠️ Only works for choices with exactly 2 options and cancel enabled


How to Use

RPG Maker MZ

Use the Plugin Command: Quick Question

QQPP

RPG Maker MV (and alternative for MZ)

Use this script call:

QuickQuestion("Your question text here");

The next Show Choices command will be handled as a Quick Question.


🎨 Customization (via Script Calls)

Set Custom Buttons

SetQuickQButtons("OK_IMAGE", "CANCEL_IMAGE");

Place two image files per button in the pictures/ folder:

  • OK_IMAGE_00.png and OK_IMAGE_01.png (hover state)
  • CANCEL_IMAGE_00.png and CANCEL_IMAGE_01.png

Example:

SetQuickQButtons("mcButtonYes", "mcButtonNo");

Set Custom Background

SetQuickQBackground("IMAGE_NAME");

The image must be placed in the pictures/ folder.

Example:

SetQuickQBackground("customBackgroundImage");

⚠️ Important Notes

  • SetQuickQButtons and SetQuickQBackground must be called after QuickQuestion.
  • Every time QuickQuestion() is called, settings reset to default plugin parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment