Use this to draw text on the screen that, unlike draw_text, can be selected and edited.
The text is confined inside an invisible box with the wished dimensions. Use draw_rectangle or sprites to design your own boxes around the text. Word-wrapping makes sure that words never exceed the box and you can make it limited to one line and much more.
Download (.zip) for GM8, GM8.1, GM:Studio, contains the two scripts and three rooms with examples of use.
Installation and use
- Copy the textbox_create and textbox_draw scripts into your game.
- Create an empty object called obj_textbox.
- Use textbox_create to make instances of the textbox object, change parameters then use the instance IDs in textbox_draw.
Click and drag: Character select
Double click: Word select
Ctrl+X/Right click menu*: Cut
Ctrl+C/Right click menu*: Copy
Ctrl+V/Right click menu*: Paste
Ctrl+A/Right click menu*: Select all
Backspace: Remove last character
Delete: Remove next character
Mouse wheel: Scroll up/down
Arrow keys: Move marker
Shift+arrow keys: Move selection start/end
Shift+click: Set selection start/end
*The right click menu is unavailable in GM:Studio. R.I.P. show_menu.
Edited by Davve, 18 October 2015 - 02:46 PM.