///drawing textbox and text
//draw_self();
if scroll_timer_sad = true{
scroll_timer = 0.13;
}
if scroll_timer_slow = true{
scroll_timer = 0.25;
}
if scroll_timer_regular = true{
scroll_timer = 0.5;
}
if scroll_timer_fast = true{
scroll_timer = 1.5;
}
if scroll_timer_scared = true{
scroll_timer = 5;
}
///drawing background of textbox
//draw_rectangle_colour(mx2 - 200, my2 - 120, mx2 - 186 + string_width(speak[num]), my2 + string_height(speak[num]), c_white, c_white, c_white, c_white, false);
if global.Convo == true && convo == true{
///setting the depth of textbox
depth = -170;
///set up the option to do certain things per sentence
///checking wich sentence player is currently reading
switch (num){
case 1:{
}
break;
case 2:{
}
break;
case 3:{
}
break;
case 4:{
}
break;
case 5:{
}
break;
case 6:{
}
break;
case 7:{
}
break;
case 8:{
}
break;
case 9:{
}
break;
case 10:{
}
break;
case 11:{
}
break;
case 12:{
}
break;
case 13:{
}
break;
case 14:{
}
break;
case 15:{
}
break;
case 16:{
}
break;
case 17:{
}
break;
case 18:{
}
break;
case 19:{
}
break;
case 20:{
}
break;
case 21:{
}
break;
case 23:{
}
break;
case 24:{
}
break;
case 25:{
}
break;
}
///end checking sentence
draw_set_font(fnt_textbox_test);
/// draw rounded rectangle chatbox
//draw_roundrect_colour(mx2 - 0, my2 - 40, mx2 - 0 + string_width(speak[num]) + 10, my2 + string_height(speak[num])- 25,c_white, c_white, 0);
///bg filler
//draw_rectangle_colour(mx2 - 0, my2 - 0, mx2 - 0 + string_width(speak[num]), my2 - 0 + string_height(speak[num]), c_white, c_white, c_white, c_white, false);
///bg outilner
//draw_rectangle_colour(mx2 - 0, my2 - 0, mx2 - 0 + string_width(speak[num]), my2 - 0 + string_height(speak[num]), c_reg, c_reg, c_reg, c_reg, true);
///drawing text
//draw_text(mx2 +5 , my2 -30, speak[num]);
///drawing highlight text
//draw_text_colour(mx2 +5, my2 -30, string_copy(speak[num], 0, scroll_text), c_reg, c_reg, c_reg, c_reg, 1);
/// drawing the "next" button
if scroll_text >= string_length(speak[num]){
///drawing sprite
//draw_sprite(spr_convo_proceed, 0, mx2 - 168 + string_widith(speak[num]), my2 - 107 + string_height(speak[num])/1.4);
seconds = 0;
count_up = false;
}
///Testing scrollable Textbox
draw_roundrect_colour(x, y, x+width, y+height, c_white, c_white, false);
//Checking if the width has been broken
if(string_width(str) > width - padding - padding)
{
//Remove the space and replace it with a line break
speak[num] = string_delete(speak[num],last_space, 1);
speak[num] = string_insert("#", speak[num], last_space);
ds_list_add(start, last_space+1);
}
//Making sure its not the end of the speak[num]
if(count < string_length(speak[num]))
{
//Set the last space variable
if(string_char_at(speak[num], count) == " ")
{
last_space = count;
}
count ++;
}
//Check if bottom box has been broken
if (string_height(str) > height-padding)
{
line++;
}
// draw textbox
///draw_text(x+padding, y+padding, str);
draw_text_colour(x+padding, y+padding, string_copy(speak[num], 0, scroll_text), c_reg, c_reg, c_reg, c_reg, 1);
// Grabs the string
str = string_copy(speak[num], ds_list_find_value(start,line),count-ds_list_find_value(start,line));
/// End Testing Scrollable Textbox
///Drawing the scrolling text (highlighting text)
if scroll_text < string_length(speak[num]){
scroll_text += scroll_timer;
}
if count_up = true{
seconds += 1 / room_speed;
}
if seconds >= scroll_timer * 1.31 && scroll_timer_sad = true{
audio_play_sound(sound_test, 10, false);
seconds = 0;
}
else if seconds >= scroll_timer * 0.6 && scroll_timer_slow = true{
audio_play_sound(sound_test, 10, false);
seconds = 0;
}
else if seconds >= scroll_timer * 0.15 && scroll_timer_regular = true{
audio_play_sound(sound_test, 10, false);
seconds = 0;
}
else if seconds >= scroll_timer * 0.027 && scroll_timer_fast = true{
audio_play_sound(sound_test, 10, false);
seconds = 0;
}
else if seconds >= scroll_timer * 0.001 && scroll_timer_scared = true{
audio_play_sound(sound_test, 10, false);
seconds = 0;
}
///Seeing if player is trying to proceed with convo
if keyboard_check_pressed(ord(next_button)){
count_up = true;
///see if text is still scrolling
if scroll_text < string_length(speak[num]){
scroll_text = string_length(speak[num]);
}
else{
///proceeding to next sentence or part of convo
if num < num_max{
num += 1;
scroll_text = 0;
}
/// checking if there is more to this convo and if player has reached breaking point
else if convo_part < convo_part_max{
convo_part += 1;
///creating a break point and/or proceeding to the next part of the convo
switch (convo_part){
case 2:{
num = 1;
num_max = 3;
convo_part = 1;
scroll_text = 0;
convo = false;
global.Convo = false;
convo_part -= 1;
}
break;
case 3:{
}
break;
case 4:{
}
break;
case 5:{
}
break;
case 6:{
}
break;
case 7:{
}
break;
case 8:{
}
break;
case 9:{
}
break;
case 10:{
}
break;
case 11:{
}
break;
case 12:{
}
break;
case 13:{
}
break;
case 14:{
}
break;
case 15:{
}
break;
case 16:{
}
break;
case 17:{
}
break;
case 18:{
}
break;
case 19:{
}
break;
case 20:{
}
break;
case 21:{
}
break;
case 23:{
}
break;
case 24:{
}
break;
case 25:{
}
break;
case 26:{
}
break;
case 27:{
}
break;
case 28:{
}
break;
case 29:{
}
break;
case 30:{
}
break;
case 31:{
}
break;
case 32:{
}
break;
case 33:{
}
break;
case 34:{
}
break;
case 35:{
}
break;
case 36:{
}
break;
case 37:{
}
break;
case 38:{
}
break;
case 39:{
}
break;
case 40:{
}
break;
case 41:{
}
break;
case 42:{
}
break;
case 43:{
}
break;
case 44:{
}
break;
case 45:{
}
break;
case 46:{
}
break;
case 47:{
}
break;
case 48:{
}
break;
case 49:{
}
break;
case 50:{
}
break;
}/// endinf of checking wich part of convoi player is moving to
}/// ending of checking current convo convo part and if there is more to current convo
else if hidden_event == true{
///increasing the counter used to tell game if player has met condition
//hidden_event_count += 1;
///Checking if a condition is need and if it has been met
if hidden_event_count < hidden_event_max{
///activate hidden event [below]
}
} /// end proceeding of next sentence
else{
///reset the whole convo or start the convo from a fixed position
num = 1;
num_max = 3;
convo_part = 1;
scroll_text = 0;
convo = false;
global.Convo = false;
exit;
}
} ///end of player pressing the "next" button
} ///end of convo being activated
}
else{
///checking if player is within talk range
///he is in talk range
if collision_circle(mx2, my2, trange, c_obj, false, true){
/// checking if player is trying to activate convo
if keyboard_check_pressed(ord(talk_button)){
global.Convo = true;
convo= true;
count_up = true;
}
}
}