StefanieBlack18
Member
Still relatively new coder here... I have been trying to find out a way to get my player to essentially pause (can't move around using the keyboard function BUT can still play the idle animation) while the textbox is up running dialog, but so far my attempts have been unsuccessful. Below is my script code in the Step section of my obj_textbox. Can anyone assist?
I was originally using
if message_draw==true
{ speed=0 }
But it wasn't working anywhere.
I was originally using
if message_draw==true
{ speed=0 }
But it wasn't working anywhere.
Code:
/// @desc Type text
scr_input();
var action_hold = keyboard_check(vk_space);
// Check if we need more characters
if (characters < message_length) {
characters += message_speed+action_hold;
// Copy string to the current character
message_draw = string_copy(message[message_current], 0, characters);
} else { // Once we have finished adding the characters
if (actionKey) {
//Check if there are more messages
if (message_current < message_end) { //Start the next message
message_current += 1;
message_length = string_length(message[message_current]);
characters = 0;
message_draw = "";
} else {
// destroy the object
instance_destroy();
}
}
}
///
///
///
if(keyboard_check_pressed(ord("E"))){
if(counter < str_len){ counter = str_len; }
else if(page < array_length_1d(text) - 1){
page++;
event_perform(ev_other, ev_user1);
} else { instance_destroy(obj_textbox);}
}
// Where to put the code if I want the player to not be able to move when a text box is open?