Tetszőleges feliratok

Top  Previous  Next

Az AL_GL unit AL_OpenGL komponensére írunk: X,Y koordinátákra, Height fontmérettel, Angle szögben.

 

 

procedure TForm1.AL_OpenGL1AfterPaint(Sender: TObject);

begin

with AL_OpenGL1 do begin

   glNewList(1,GL_COMPILE);

   glPrint(0,0,1,0,'Stella');

   glColor3d(1,1,1);

   glPrint(10000,10000,1000,30,'Uff');

   glPrint(200000,100000,10000,-30,'Uff');

   glEndList;

   glCallList(1);

end;

end;

 

procedure TAL_OpenGL.glPrint(x,y,Height,Angle: double; text: string);

begin

if glt=nil then BuildFont('Arial')

else begin

     glPushMatrix;

     glTranslatef(x,y,0);

     glRasterPos2d(x,y);

     glRotatef(Angle,0,0,1);

     glScaled(Height,Height,0);

     glt.glShowStr(PChar(text));

     glPopMatrix;

end;

end;