Reddoka
Member
I wrote the following code to create the queuing text boxes like the tutorial, but then when I started running the game the textbox didn't appear. Can anyone help me ??? Thanks a lot! <3
Here's the code of Newtextbox's script:
The object oText's Step event:
The object oTextQ's Create event:
And its Step event:
Finally, the object oGame's Left down event:
Here's the code of Newtextbox's script:
GML:
var _obj
if (instance_exists(oText)) _obj = oTextQ; else _obj = oText;
with (instance_create_layer(0,0,"Instances",_obj))
{
message = argument[0];
if (instance_exists(other)) originInstance = other.id else originInstance = noone;
if (argument_count > 1) background = argument[1]; else background = 1;
}
Code:
lerpProgress += (1 - lerpProgress) / 50;
textProgress += global.textSpeed;
x1 = lerp(x1,x1Target,lerpProgress);
x2 = lerp(x2,x2Target,lerpProgress);
if (mouse_check_button(mb_left) or keyboard_check_pressed(vk_space))
{
var _messageLength = string_length(message);
if (textProgress >= _messageLength)
{
instance_destroy();
if (instance_exists(oTextQ))
{
with (oTextQ) ticket--;
}
}
else
{
if (textProgress > 2)
{
textProgress = _messageLength;
}
}
}
GML:
ticket = instance_number(oTextQ);
Code:
if (ticket == 0)
{
instance_change(oText, true);
}
GML:
Newtextbox("Text text text");
Newtextbox("Text text more text")