- function tfont.getlength;
- var i:integer;
- begin
- result:=0;
- for i:=0 to length(str)-1 do
- begin
- result:=result+gmf[pbyte(str[i])^].gmfcellincx;
- end;
- end;
- procedure tfont.write;
- begin
- glcolor4f(c.r,c.g,c.b,c.a); // <-- unwichtig, aber das geht...
- glpushmatrix;
- case pos of
- font_left:
- begin
- gltranslatef(x,y,z);
- end;
- font_center:
- begin
- gltranslatef(x-getlength(str)/2,y,z);
- end;
- font_right:
- begin
- gltranslatef(x-getlength(str),y,z);
- end
- else
- begin
- gltranslatef(x,y,z);
- end;
- end;
- glpushattrib(gl_list_bit);
- gllistbase(base);
- glcalllists(length(str),gl_unsigned_byte,str);
- glpopattrib;
- glpopmatrix;
- end;