Asset - Extension Menu and Input System - Make a controls menu in one line of code!

Misi

Member
main.png sliders.png graphics.png controls.png credits.png

This extension adds a menu and input system to GameMaker Studio 2 version 2.3.1+


With these systems, you can:
  • Create a title and pause menu in no time.
  • Organize multiple inputs like vk_right, ord("D") and gp_padr into a single category/action right
  • And combine these two to create a controls menu based on an input system in one line of code where the player can edit the inputs.

You can buy this extension on the GameMaker Marketplace or on itch.io.

You can create menu pages where you can put different elements like:
  • sliders
  • toggles
  • credits
  • shifts (multi-option select)
  • controls as previously mentioned

And then you can set things according to that.

Additional features of the menu:
  • Automatic sizing - the menu adjusts the size of it's elements to your window size
  • Pause system - pause any game with one function
  • Saving and loading - saves the settings and even the controls automatically
  • Easily customizable look

Please note that this menu can only be used with a keyboard or gamepad. Mouse and touch controls are not available.

The input system makes dealing with any type of inputs very easy. Basically, you can organize a bunch of inputs (keyboard, mouse, gamepad) into categories like right or jump. And then check them all in one line.

But it can do much more than that. Here is a list of other things it can do:
  • Checking any type of input with the inputCheck() function
  • Getting the last gamepad input pressed similar to keyboard_key
  • Getting the last input pressed from any type
  • Getting the type of any input
  • Turning an input into a string (good for drawing and debugging)
  • Drawing inputs with nice-looking icons
  • Replacing ord("X") with "x"
  • Replacing gamepad_axis_value() with new constants like gp_axislr
  • Checking gamepad axis inputs as pressed
  • Saving and loading Input Systems in one line
  • More vk constants

If you have any questions just write me an email: [email protected]
 
Last edited:

kburkhart84

Firehammer Games
Oooh, competition! I see you say it supports mapping inputs to categories(I guess those would be actions). Does it do mapping by button press, like you tell the player to press the input and it assigns whatever they pressed?

I find it interesting that you integrated the inputs with the menu system...but why did you make it not support mouse/touch? Is it just you haven't gotten it in yet? I know that feeling, my system does the mouse buttons but doesn't handle the mouse movement at all.

EDIT****

I promise this wasn't meant as sarcasm though the first part comes across as such possibly. I'm sincerely interested in what other people do with input systems.
 

Misi

Member
To answer your question, the input mapping in the controls menu works like you select a slot press enter, and then the next input you press (can be keyboard, mouse, or gamepad) will be assigned to that slot.

And I didn't include mouse support for the menu because it wouldn't be easy to implement and it doesn't fit well with how the menu works. But I might add support for it later.
 

kburkhart84

Firehammer Games
To answer your question, the input mapping in the controls menu works like you select a slot press enter, and then the next input you press (can be keyboard, mouse, or gamepad) will be assigned to that slot.

And I didn't include mouse support for the menu because it wouldn't be easy to implement and it doesn't fit well with how the menu works. But I might add support for it later.
Very nice! My system is more focused on gametime input handling instead of doing anything with menus like yours does. So I added stuff liking tracking how long the inputs are pressed down and similar, and detailed stuff about handling the input mapping...but I didn't do a single thing to integrate it into a menu system. I also didn't do anything to expose the actual inputs except as "descriptions" so you can show them to the players. So it looks like though there is some cross-functionality between our systems, they have different focal points. Good luck with yours. I'm willing to help if you ever need it.
 

Misi

Member
Thank you very much. I checked out your input system, it is has a lot of great functionality. I especially like that you can check how long an input has been held down, mine doesn't have that. And if you have any more questions in the future feel free to ask!
 

kburkhart84

Firehammer Games
I especially like that you can check how long an input has been held down,
I had to set a value for axes on gamepads as well to make that one work. It is configurable via #macros, but by default, if the axis is tilted 0.75 or more, it is considered down/pressed. So I store the raw value between 0 and 1, but then I store if it is down right now, if it was just pressed down this step, if it was just released this step, and for how long it is down(both in steps and seconds). Another quirk I did with axes was to make each axes be two separate inputs, so the negative X is one thing, and the positive X is another. I did that so that if somebody was using the 4 directions for different functions that aren't directly related to each other, the actions and mapping treats it as seperate.
 

Misi

Member
I did that so that if somebody was using the 4 directions for different functions that aren't directly related to each other, the actions and mapping treats it as seperate.
Mine works the same, I have made eight constants for the four directions of both axes. So for instance, I have gp_axislr for the left stick right and gp_axisru for the right stick up etc.
 
Top