I was looking at the scrolling text-box code and trying to butcher it to fit -
if I wanted, like in Rysen's tutorial, to be able to determine what text appears in a text box via typing it in maped3 -
would this code work?
void TextBox()
{int textfont = LoadFont("font1.png", 10, 12);
EnableVariableWidth(textfont);
int fps=0;
int fpscount=0;
int choice=0;
int blue=RGB(0,0,255);
int black=RGB(0,0,0);
int yellow=RGB(255,255,0);
int red=RGB(255,0,0);
int green=RGB(0,255,0);
int textbox5=TT64_TextBox(textfont,12,4,20,300,blue,blue,black,black, 35, SCAN_A,
100, PrintString(screen,MyFont,text));
int time=systemtime;
int wait=systemtime;
while (!key[SCAN_ESC])
{
Splash(0,255,0);
if (choice!=2)
{
if (choice==0) TT64_RenderTextBox(textbox1);
if (choice==1) TT64_RenderTextBox(textbox4);
TT64_RenderTextBox(textbox2);
TT64_RenderTextBox(textbox3);
}
if (choice==2)
{
TT64_RenderTextBox(textbox5);
}
if (systemtime>=time+100)
{
time=systemtime;
fps=fpscount;
fpscount=0;
}
else fpscount++;
printstring(2,2,screen,textfont,"FPS: "+str(fps));
ShowPage();
if (key[SCAN_ENTER] && systemtime>=wait+20)
{
wait=systemtime;
if (choice==0) choice=1;
else choice=0;
TT64_OpenTextBox(textbox5);
}
if (key[SCAN_T] && systemtime>=wait+20)
{
wait=systemtime;
choice=2;
}