Are there any way besides using the GLXFont component to display a string of text on the screen using GLXTreem?
Are there any way besides using the GLXFont component to display a string of text on the screen using GLXTreem?
BK - we.create (tm)
Except from having text as images and displaying them that way, no, there's however one other way of printing fonts in opengl, lesson #13 on NeHe, however they're not 100% accurate with GLXTreem's surfacewidth and surfaceheight parameters.
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
oh, I see. thanks for the reply *reads lesson *13*
BTW: any good suggestions on how to create text effects such as fade out, deformation etc?
BK - we.create (tm)
Sorry, missed the btw before, here's some tips for text effects:Originally Posted by Mrwb
Fading:
[pascal]
GLXFont1.Items[0].Color.Alpha:= Sin(GLXTimer1.ElapsedTime / 1000);
GLXFont1.Items[0].TextOut(0,0, Text);
[/pascal]
Deformation - Horisontal scale;
[pascal]
glPushMatrix();
glScalef(Sin(GLXTimer1.ElapsedTime / 1000),1,1);
GLXFont1.Items[0].TextOut(0,0, Text);
glPopMatrix();
[/pascal]
Deformation - Per character rotation (really cool):
[pascal]
var Text: String;
var Counter: Integer;
glPushMatrix();
glTranslatef(0,64,0);
For Counter:=1 to Length(Text) do begin
glPushMatrix();
glScalef(1, Sin(GLXTimer1.ElapsedTime / 1000 + Counter / 10),1);
GLXFont1.Items[0.TextOut(GLXFont1.Items[0].TextWidth(Copy(Text,1, Counter)),0,Text[Counter]);
glPopMatrix();
end;
glPopMatrix();
[/pascal]
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
Bookmarks