Results 1 to 5 of 5

Thread: Text Q

  1. #1

    Text Q

    Are there any way besides using the GLXFont component to display a string of text on the screen using GLXTreem?
    BK - we.create (tm)

  2. #2

    Text Q

    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

  3. #3

    Text Q

    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)

  4. #4

    Text Q

    Quote Originally Posted by Mrwb
    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?
    Sorry, missed the btw before, here's some tips for text effects:

    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

  5. #5

    Text Q

    Nice! Thanks!
    BK - we.create (tm)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL