From e3fd266cf256a7cb930eb0c8618d51f05309a561 Mon Sep 17 00:00:00 2001 From: serpentspirale Date: Tue, 4 Aug 2020 19:17:12 +0200 Subject: [PATCH] Added basic documentation (#1) Only available in English, too lazy to translate it in my native language. --- README.md | 358 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e3fe19e --- /dev/null +++ b/README.md @@ -0,0 +1,358 @@ +# 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.](#visual-customization) + +### 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. + +
+ + + +