Comunidad Game Maker

Ayuda => Preguntas y respuestas => Mensaje iniciado por: FernandoNavarro en Enero 21, 2020, 09:50:12 PM

Título: Cursor de texto que se mueva y edite texto
Publicado por: FernandoNavarro en Enero 21, 2020, 09:50:12 PM
Hola buenas, hace un tiempo publiqué un tema parecido, pero no pude obtener resultado, y al parecer en los foros que han tocado el tema de un cursor no tienen la necesidad de mover el cursor.
Bueno, el tema es que estoy haciendo un input text box y quiero que el cursor ("|") que ya agregué sea capaz de moverse con las flechas direccionales. Hasta el momento llevo algo así:

[spoiler]
[gml]
var keyLeft, keyRight;
keyLeft = keyboard_check_pressed(vk_left);
keyRight = keyboard_check_pressed(vk_right);

if (keyLeft)
{
    strTextLeft = strTextLeft + string_copy(strText, string_length(strText), 1);
    strText = string_delete(strText, string_length(strText), 1);
}

if (keyRight)
{
    strText = strText + string_copy(strTextLeft, 1, 1);
    strTextLeft = string_delete(strTextLeft, 1, 1);
}
[/gml]
[/spoiler]
Título: Re:Cursor de texto que se mueva y edite texto
Publicado por: FernandoNavarro en Enero 21, 2020, 10:41:23 PM
Pues me resolví solo, sólo faltaba actualizar la variable keyboard_string