Authentic Native Textbox creates native textboxes that are overlaid on top of the game. Because of this it's not possible to draw anything over them.
Textboxes are created in code and must be manually cleaned up. Textboxes will automatically launch the virtual keyboard whenever they are pressed and will handle copy/pasting, selections, and other various features you expect in textboxes on the native platforms.
To detect if the virtual keyboard is out you cannot use the inbuilt keyboard_virtual_status() as it will not detect if the keyboard was launched by a textbox. However keyboard_virtual_height() works as normal and can be used instead.
Returns: Created textbox
Creates a new textbox and returns it.
Arguments
textbox | Textbox to remove |
Returns: 0 if successful, -1 if not
Removes the provided textbox
Arguments
textbox | Textbox to apply to |
x | Position y in pixels |
y | Height in pixels |
width | Width in pixels |
height | Height in pixels |
Returns: 0 if successful, -1 if not
Positions the provided textbox at the given location.
Arguments
textbox | Textbox to apply to |
size | Size of the text inside the box in pts |
Returns: 0 if successful, -1 if not
Sets the size of the text in the textbox. The value is in points and should match what the equivalent font is set to in GameMaker.
Arguments
textbox | Textbox to apply to |
font | Name of the font to style the textbox with |
Returns: 0 if successful, -1 if not
Sets what font the textbox should use on an Android system.
The available fonts are as follows
Identifier to provide | Actual font |
sans-serif-thin | Roboto Thin |
sans-serif-light | Roboto Light |
sans-serif | Roboto Regular |
sans-serif-medium | Roboto Medium |
sans-serif-black | Roboto Black |
sans-serif-condensed-light | Roboto Condensed Light |
sans-serif-condensed | Roboto Condensed Regular |
sans-serif-condensed-medium | Roboto Condensed Medium |
serif | Noto Serif |
monospace | Droid Sans Mono |
serif-monospace | CutiveMono |
cursive | Dancing Script |
sans-serif-smallcaps | CarroisGothic SC |
Arguments
textbox | Textbox to apply to |
font | Name of the font to style the textbox with |
Returns: 0 if successful, -1 if not
Sets what font the textbox should use on an iOS system. The available fonts can be found here.
Arguments
textbox | Textbox to apply to |
type | Type of textbox this should be |
capitalization | Type of capitalization this textbox should use |
autocorrect | Type of autocorrect this textbox should use |
Returns: 0 if successful, -1 if not
Sets the textbox's style on all platforms. This will replace anything previously set by the platform specific style functions. The function arguments expect macros.
This constant is used to decide what type of keyboard to show.
Keyboard type | Description |
ant_style_type_default | Shows a default keyboard |
ant_style_type_ascii | Shows a keyboard with ascii only |
ant_style_type_url | Shows a keyboard for url input |
ant_style_type_email | Shows a keyboard for email input |
ant_style_type_password | Hides the entered text and does not allow copying |
ant_style_type_numbers | Shows a numberpad |
This constant is used to determine how the text should be capitalized
Capitalization type | Description |
ant_style_capitalize_none | Nothing is capitalized |
ant_style_capitalize_words | Words are capitalized |
ant_style_capitalize_sentences | Sentences are capitalized |
ant_style_capitalize_all | All text is capitalized |
This constant determines if autocorrect should be enabled or not
Autocorrection type | Description |
ant_style_autocorrect_off | Autocorrect is disabled |
ant_style_autocorrect_on | Autocorrect is enabled |
Arguments
textbox | Textbox to apply to |
text | Text to set inside the textbox |
Returns: 0 if successful, -1 if not
Sets the text of the textbox to the provided string
Arguments
textbox | Textbox to get text from |
Returns: Text of the textbox
Gets the text currently inside the textbox as a string
Arguments
textbox | Textbox to apply to |
color | BGR color value |
alpha | Alpha value 0-1 |
Returns: 0 if successful, -1 if not
Sets the color and alpha of the text inside the textbox. Will not affect other textbox graphical elements, like the selection color/strength.
Arguments
textbox | Textbox to focus |
Returns: 0 if successful, -1 if not
Focuses the provided textbox. This will select it and show the virtual keyboard, if applicable.
Arguments
textbox | Textbox to unfocus |
Returns: 0 if successful, -1 if not
Unfocus the provided textbox. This will deselect it and prevent further input from reaching it.
Arguments
textbox | Textbox to check |
Returns: 0 if successful, -1 if not
Returns if the textbox is focused or not.
Arguments
textbox | Textbox to apply to |
Returns: True if the textbox hit submit, otherwise false
Returns true if the user has clicked the submit/enter key on the keyboard, since this function was ran last.
Arguments
textbox | Textbox to apply to |
enabled | Controls if the textbox is enabled or not |
Returns: 0 if successful, -1 if not
Configures if the textbox is visible and interactable. If enabled is set to false, the textbox will not be visible or pressable.
Arguments
textbox | Textbox to apply to |
focusable | Controls if the textbox is focusable or not |
Returns: 0 if successful, -1 if not
Set if the textbox is clickable or not. If it’s set to false the textbox will not be able to be pressed, but will still be visible.
Arguments
textbox | Textbox to apply to |
style | Style-flags to apply to the textbox |
Returns: 0 if successful, -1 if not
Applies the provided flags to the textbox on Android. This lets you mark a textbox as made for passwords, emails etc. All the constants are available here. To pass multile flags, use a bitwise or "|". This is only intended to be used if you require special functionality, for general use the normal style function is recommended.
Arguments
textbox | Textbox to apply to |
type | Type of textbox this should be |
capitalization | Type of capitalization this textbox should use |
autocorrect | Type of autocorrect this textbox should use |
Returns: 0 if successful, -1 if not
Applies the provided flags to the textbox on iOS. This lets you mark a textbox as made for emails, phone numbers etc. All the constants are available here. This is only intended to be used if you require special functionality, for general use the normal style function is recommended.
Arguments
textbox | Textbox to apply to |
password | If true, textbox is marked as password input |
Returns: 0 if successful, -1 if not
Sets the box to be treated as a password box in iOS. This means the text will be converted into stars and you will not be able to copy text from it.