GameMaker Writing strings in-game

N

NNNIKKI

Guest
In my game, I want to be able to write strings via keyboard input in-game. I tried to do this.
In the object that is the textbox, I have 3 events:
-Left Pressed event:
global.textselect = id;

-Step event
if (global.textselect != id) || (string_length(global.title) > 14) exit;
if (keyboard_check_pressed(ord("Q"))) string_insert("Q",global.title,string_length(global.title));

-Draw event
draw_self();
draw_set_color(c_black);
draw_set_font(font2);
draw_text(x-96,y-16,global.title);

This is what is in the initializing event (room creation code in the initialize room)
global.title = "";
global.textselect = noone;

For some reason, nothing is happening. Why?
 
N

NNNIKKI

Guest
Nvm. I just realized that I need to write:
global.title = insert_string(blablabla);
I hope that this helps somebody!
 
Top