scrolling textboxes...
Displaying 1-1 of 1 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
relaxis

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;
}

Posted on 2006-07-12 08:23:03


Displaying 1-1 of 1 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.