
Dynamic Button Icons for RPG Developer Bakin
A downloadable tool
An easy to use C# script to dynamically show keyboard and game controller icons corresponding to the exact keybindings assigned!
割り当てられたキーバインディングに正確に対応するキーボードとゲームコントローラーのアイコンを動的に表示する、使いやすいC#スクリプト!
Prerequisites | 前提条件
EN
There are two external downloads you'll need to do for this to work:
- tometome_g's GamePadOrKeyboard C# script: This allows you to toggle a switch on or off if the gamepad or keyboard was last used. Download Link
- Kenney's Input Prompts icons: We specifically download this icon pack since it's got a font option for each pack, and this addon uses the unicode bindings for the icons for these icons. You can use other fonts filled with button icons, but you'll need to alter the script in that case. Download Link
First, create a common event, and attach the GamePadOrKeyboard script to it. Then, create a C# event with the function HeaderPanel, and set X to a new variable called "gamepadInUse" and Y to "kbmouseInUse". Have it run at the start of the game (assuming you've disabled title screen and use a custom one). If you've already used this addon and has the variables named differently, it's fine, but just keep in mind the preset layout that comes with this addon will use those names instead in the conditional render, so you'll need to either edit each one to your variable, or you can rename them to the ones mentioned here, import the layout, and then edit the name of the variables back to the ones you had to batch rename them throughout the project, including inside the preset layout.
Next, extract Kenney's Input Prompts and import into Bakin the following fonts:
- kenney_input_xbox_series.otf
- kenney_input_steam_deck.otf
- kenney_input_nintendo_switch.otf
- kenney_input_playstation_series.otf
- kenney_input_keyboard_&_mouse.otf
Each font is located inside the "Font" folder located inside the folder corresponding to each console/platform.
Make sure to adjust the font size to 100, since the buttons themselves are incredibly small.
Now you're ready to install the addon, so download it down below and follow along!
JP
これを動作させるには、以下の2つの外部ダウンロードが必要です:
- tometome_gのGamePadOrKeyboard C#スクリプト:ゲームパッドまたはキーボードが最後に使用された場合に、スイッチのオン/オフを切り替えることができます。 DL
- Kenney's Input Prompts アイコン: このアイコンパックは各パックごとにフォントオプションが用意されているため、特にダウンロードしています。このアドオンはこれらのアイコンに対してユニコードバインディングを使用します。ボタンアイコンで埋め尽くされた他のフォントを使用することも可能ですが、その場合はスクリプトを変更する必要があります DL
まず、共通イベントを作成し、GamePadOrKeyboardスクリプトをアタッチします。次に、HeaderPanel関数を持つC#イベントを作成し、Xを「gamepadInUse」という新規変数に、Yを「kbmouseInUse」に設定します。ゲームの開始時に実行するように設定してください(タイトル画面を無効化し、カスタム画面を使用している場合)。既にこのアドオンを使用しており変数名が異なる場合でも問題ありませんが、 問題ありませんが、このアドオンに付属するプリセットレイアウトでは条件付きレンダリング時に上記の変数名が使用される点に留意してください。そのため、各変数を自身の変数名に編集するか、ここで言及した名前に変更してレイアウトをインポートした後、プロジェクト全体(プリセットレイアウト内も含む)で一括変更した元の変数名に戻す必要があります。
次に、Kenneyの入力プロンプトを抽出し、以下のフォントをBakinにインポートしてください:
- kenney_input_xbox_series.otf
- kenney_input_steam_deck.otf
- kenney_input_nintendo_switch.otf
- kenney_input_playstation_series.otf
- kenney_input_keyboard_&_mouse.otf
各フォントは、各コンソール/プラットフォームに対応するフォルダ内の「Font」フォルダ内に配置されています。
フォントサイズを100に必ず調整してください。ボタン自体が非常に小さいからです。
それではアドオンをインストールする準備が整いました。下記からダウンロードして、手順に従ってください!
Addon Usage | アドオンの使用
EN
Create a new common event called "InputNameFinder", and attach the script "InputBindNameFinder.cs" to it.
Create a cross-save variable called "game_controller_icons" but don't assign a value to it in an event.
Instead, create a C# event tied to the function "SetGamepadIconSet", and place the value of "game_controller_icons" in the parameter.
Then under it, create a C# event tied to the function "FindAndSetBindings".
Next, go to the Layout tool, open the Free Layouts, and then import the file "ButtonIconsLayout.lyrbr" by pressing the folder with an arrow going down icon. The import button might be hidden by a small arrow, so click it to reveal the rest of the top bar icons.

To test if your code is working, at the start of the game, add this free layout to the screen. If the icons are showing correctly based on your keybinds, then it should be working.
(Please note: by default the shown value is a 0 in the layout editor for variables, you need to test it in test play to show the actual buttons)
But we're not done just yet: in the options layout, create a new button in the menu with a spinner object (copy an existing button with one). Call this option something like Controller Icons, and in the spinner properties, set the spinner name to "XBOX\nPLAYSTATION\nSWITCH\nSTEAM DECK". The order is important (but the text itself can be anything really) since these go from 0 to 3 as a number that'll then be checked by the C# script to determine which icon set to use, but if you wish to remove consoles you don't need, you can edit the C# script to change the indexes as needed.
Lastly, create a common event that runs in parallel. Inside of it, simply check the value of the "game_controller_icons" cross-save variable to a new normal variable, you can call it "lastKnownGamepadIcon" if you want. If it's different, assign the cross-save variable to "lastKnownGameIcon", and then call the common event InputNameFinder once from within the condition met area. That way, when you go to the options menu, it should update the icons for gamepad in real time when you go left and right.
And that's the gist of getting the system working! A few things to note:
- In the preset layout that came with this script, there are a few folders corresponding to the actions that can be bound to different keys, such as ACTION3 or JUMP. Inside they are configured to have two folders, one for gamepad and one for keyboard/mouse. Inside the gamepad folder, there's 4 additional folders for each controller icon type.
- If the icons aren't working in game, double check if the fonts have been properly assigned to the text objects. If they are not, then make sure to assign the proper fonts again (if this happens, this could be an issue with the import layout process, but I haven't tested it). The fonts to assign in a single action folder are:
- "kenney_input_xbox_series" for the Xbox text
- "kenney_input_playstation_series" for the Playstation text
- "kenney_input_nintendo_switch" for the Nintendo Switch text
- "kenney_input_steam_deck" for the Steam deck text
- "kenney_input_keyboard_&_mouse" for both the keyboard and the mouse texts
- To add the icons to any layout of your choice, simply copy and paste the entire folder corresponding to the action you want to appear from the sample layout into the layout of your choice.
- To change the color or other text properties of the prompt, simply change the font color, drop shadow, etc, of each text object in the action prompt.
- You can batch edit multiple text objects by holding CTRL and selecting each one.
- The preset layout doesn't come with all the possible actions in Bakin. To configure one for an action I didn't get supply, please check the file "keybinds for UI.txt".
- Inside this file is a generated list of all the variables you can supply into the text field of the various button icons.
- Copy and paste the value you want into the text fields.
- There are two categories of "actions": one for MAP, and one for MENU. Be careful when using the strings here, as they do not share the same bindings (ex: MAP_UP is different from MENU_UP in terms of key bindings).
- You do not need to manually create these variables in the variables list, they will work and be generated on the fly as long as these variables are used in text fields.
JP
新しい共通イベント「InputNameFinder」を作成し、スクリプト「InputBindNameFinder.cs」をそれにアタッチします。
「game_controller_icons」というクロスセーブ変数を作成しますが、イベント内で値を割り当てないでください。
代わりに、関数「SetGamepadIconSet」に紐づくC#イベントを作成し、パラメータに「game_controller_icons」の値を設定してください。
次に、その下に「FindAndSetBindings」関数に紐づくC#イベントを作成します。
次に、レイアウトツールに移動し、フリーレイアウトを開きます。その後、下向きの矢印が付いたフォルダーアイコンをクリックして「ButtonIconsLayout.lyrbr」ファイルをインポートします。インポートボタンは小さな矢印で隠れている場合がありますので、クリックして上部バーのアイコンを表示させてください。
コードが正常に動作しているか確認するため、ゲーム開始時にこのフリーレイアウトを画面に追加してください。キーバインドに基づいてアイコンが正しく表示されていれば、正常に動作しているはずです。
ご注意:デフォルトでは、変数レイアウトエディタに表示される値は0です。実際のボタンを表示するにはテストプレイで確認する必要があります)
しかしまだ完了ではありません:オプションレイアウトで、スピナーオブジェクト付きの新しいボタンをメニューに作成してください(既存のボタンをコピーして作成)。このオプションを「コントローラーアイコン」のような名前にし、スピナーのプロパティでスピナー名を「XBOX\nPLAYSTATION\nSWITCH\nSTEAM DECK」に設定します。順序は重要です(ただしテキスト自体は任意で構いません)。これらは0から3までの数値として扱われ、C#スクリプトによってチェックされ、使用するアイコンセットが決定されます。ただし、不要なコンソールを削除したい場合は、C#スクリプトを編集してインデックスを必要に応じて変更できます。
最後に、並行して実行される共通イベントを作成します。その内部で、クロスセーブ変数「game_controller_icons」の値を新しい通常変数にチェックします。必要に応じて「lastKnownGamePadIcon」などと命名できます。値が異なる場合、クロスセーブ変数を「lastKnownGameIcon」に代入し、条件を満たしたエリア内で共通イベントInputNameFinderを一度呼び出します。これにより、オプションメニューで左右に操作した際、ゲームパッドのアイコンがリアルタイムで更新されるはずです。
システムを動作させるための要点は以上です!注意点として:
- このスクリプトに付属するプリセットレイアウトには、ACTION3やJUMPなど、異なるキーに割り当て可能なアクションに対応するフォルダがいくつか存在します。各フォルダ内には、ゲームパッド用とキーボード/マウス用の2つのフォルダが設定されています。ゲームパッドフォルダ内には、各コントローラーアイコンタイプごとに4つの追加フォルダがあります。
- ゲーム内でアイコンが機能しない場合、テキストオブジェクトにフォントが正しく割り当てられているか再確認してください。割り当てられていない場合は、適切なフォントを再度割り当ててください(この現象が発生する場合、インポートレイアウト処理の問題である可能性がありますが、未検証です)。シングルアクションフォルダ内で割り当てるべきフォントは以下の通りです:
- Xbox用テキスト「kenney_input_xbox_series」
- PlayStationテキスト用の「kenney_input_playstation_series」
- Nintendo Switch用テキスト「kenney_input_nintendo_switch」
- Steam Deckのテキスト用「kenney_input_steam_deck」
- キーボードとマウスの両方のテキストに対して「kenney_input_keyboard_&_mouse」
- 任意のレイアウトにアイコンを追加するには、サンプルレイアウトから表示させたいアクションに対応するフォルダ全体をコピーし、目的のレイアウトに貼り付けるだけです。
- プロンプトの色やその他のテキストプロパティを変更するには、アクションプロンプト内の各テキストオブジェクトのフォントカラーやドロップシャドウなどを変更するだけです。
- 複数のテキストオブジェクトをまとめて編集するには、Ctrlキーを押しながら各オブジェクトを選択します。
- プリセットレイアウトには、Bakinで可能なすべてのアクションが含まれていません。提供されていないアクション用に設定するには、「keybinds for UI.txt」ファイルを確認してください。
- このファイル内には、各種ボタンアイコンのテキストフィールドに入力可能なすべての変数の生成リストが含まれています。
- 必要な値をコピーして、テキストフィールドに貼り付けてください。
- 「アクション」には2つのカテゴリがあります:MAP用とMENU用です。ここで使用する文字列には注意が必要です。これらは同じキーバインドを共有しません(例:MAP_UPとMENU_UPはキーバインドが異なります)。
- これらの変数は手動で変数リストに作成する必要はありません。テキストフィールド内で使用される限り、自動的に生成され機能します。
Issues | 問題点
Mouse buttons aren't currently working: this might be an issue tied to Bakin, so you might need to wait before it gets patched. It is unlikely that you'll ever need to rebind mouse buttons for most purposes, so I don't think it's too bad if you hardcode some of the icons in the mean time (to hardcode a button, copy the unicode symbol from the Kenney font map txt that comes with the font, search it online, copy the symbol, and paste it in the text field).
マウスボタンが現在動作していません:これはBakinに関連する問題である可能性があり、修正パッチが適用されるまで待つ必要があるかもしれません。ほとんどの用途ではマウスボタンの再割り当てが必要になることはまずないため、当面の間は一部のアイコンをハードコードしても問題ないでしょう(ボタンのハードコード方法:フォント付属のKenneyフォントマップtxtからユニコード記号をコピー→オンラインで検索→記号をコピー→テキストフィールドに貼り付け)。
---
Feel free to modify and redistribute this script with any improvements you can make to it.
このスクリプトを自由に修正し、改善を加えた上で再配布してください。
| Published | 3 hours ago |
| Status | Released |
| Category | Tool |
| Author | Meringue Rouge |
| Genre | Role Playing |
| Tags | bakin, Buttons, Graphical User Interface (GUI), JRPG, plugin, rpgbakin, rpg-developer-bakin, RPG Maker, User Interface (UI) |
Download
Click download now to get access to the following files:
Development log
- Dynamic Button Icons released!3 hours ago

Comments
Log in with itch.io to leave a comment.
Whoaaa,
Noiceee!