Skip to content

This repo provides a tactile keyboard extension for Game Maker Studio.

Notifications You must be signed in to change notification settings

Mathias-Boulay/GameMaker-Android-Keyboard

Repository files navigation

Android/IOS keyboard for Game Maker Studio (1.4/2 ?)

Introduction

I created this keyboard because there was no good free keyboard on the marketplace.

Furthermore, paid extensions were for the native keyboard, which means we need a different keyboard for both IOS and Android, alongside the lack of customization they have.

So I spent 20 initial hours creating this keyboard, and less than 4 a few days after to fix few bugs and optimize the project.

Features

  • Fast and easy to setup !
  • Highly customizable through simple and straightforward functions scripts !
  • Minimal performance impact on your game !
  • Supports up 5 keys at the same time !
  • Compatible both Android and IOS !

Setup

Create the keyboard

keyboard_create(Left_position, Top_position, Width, Height);

Then customize it with to get the design you want.

Get keyboard text

keyboard_get_text();

returns: String

Clear keyboard text

keyboard_clear_text();

Destroy the keyboard

keyboard_destroy();



Obtaining key presses

Obtaining last pressed key

keyboard_get_lastkey();

returns: String

Obtaining pressed key

keyboard_get_pressed_key();

returns: String

Obtaining released key

keyboard_get_released_key();

returns: String




Keyboard coordinates

The x and y coordinates represents the top left of the keyboard. However, DON'T move the keyboard by accessing directly thoses values !

The keyboard is defined by its 4 borders (Left, Top, Right, Bottom). You can set and/or get the coordinate of any of the keyboard borders.

Moving the keyboard around

Move the keyboard from its top border

keyboard_set_from_top(Y_coordinate);

Move the keyboard from its bottom border

keyboard_set_from_bottom(Y_coordinate);

Move the keyboard from its left border

keyboard_set_from_left(X_coordinate);

Move the keyboard from its right border

keyboard_set_from_right(X_coordinate);

Getting keyboard coordinates

Get the top border

keyboard_get_bbox_top();

returns: real number

Get the bottom border

keyboard_get_bbox_bottom();

returns: real number

Get the left border

keyboard_get_bbox_left();

returns: real number

Get the right border

keyboard_get_bbox_right();

returns: real number




Visual customization

The keyboard have many visual properties that can be customized. I don't want to describe them all but here I am


Keyboard Size

Resize the keyboard

keyboard_resize(Width, Height);

Get keyboard size

keyboard_get_width();

returns: real number

keyboard_get_height();

returns: real number


Keyboard background

Background state

keyboard_set_background_visible(Boolean);

keyboard_get_background_visible();

returns: boolean

Background color

keyboard_set_background_color(Color);

keyboard_get_background_color();

returns: color

Keyboard font

Font used

keyboard_set_font(Font);

keyboard_get_font();

returns: Font index

Font color

 keyboard_set_text_color(Color);

keyboard_get_text_color();

returns: color

Keyboard keycaps

State

keyboard_set_keycaps_visible(boolean);

Corners

keyboard_set_keycaps_radius(real_number);

If desired, you can set the radius on each axis individually.

keyboard_set_keycaps_x_radius(Radius);
keyboard_set_keycaps_y_radius(Radius);

Offsets

keyboard_set_keycaps_offset(Offset);

If desired, you can set the offset on each axis individually.

keyboard_set_keycaps_x_offset(Offset);
keyboard_set_keycaps_y_offset(Offset);

Colors

Idle state

keyboard_set_keycaps_color(Color);

keyboard_get_keycaps_color();

returns: color

Pressed state

keyboard_set_keycaps_pressed_color(Color);

keyboard_get_keycaps_pressed_color();

returns: color




Things to improve on the keyboard

  • Check if it works with GM 2 I guess, or port it for GM 2 if it doesn't
  • Performance, always better performance ! Without kidding, drawing with round_rect on the surface is extremely inefficient.
  • Better handling of spriteless special keys like ENTER, DELETE...
  • Add a resizing system for keys with a sprite.
  • Make the keyboard works as a normal keyboard to allow seemless integration from a PC typing game !
  • And surely other things that I can't think of right now.

About

This repo provides a tactile keyboard extension for Game Maker Studio.

Resources

Stars

Watchers

Forks

Packages

No packages published