Class TSimpleTextureFont
Unit
Declaration
type TSimpleTextureFont = class(TCastleFont)
Description
Font using a texture to define character images with constant width and height.
This class has some assumptions about how the font image looks like: the characters are drawn in ASCII order, starting from space, on an image. Derive your own descendants of TCastleFont to have more flexibility, see the implementation of this class — it is quite simple. Or use TTextureFont that can read data from a FreeType (like ttf) font file.
See e.g. castle_game_engine/examples/fonts/data/sonic_asalga_0.png how to prepare an image for use with such font. You can find more such fonts on the Internet, see e.g. http://opengameart.org/content/sonic-font and http://opengameart.org/content/null-terminator.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleFont
- TSimpleTextureFont
Overview
Methods
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure Load(AImage: TCastleImage; const AImageCols, AImageRows, ACharMargin, ACharDisplayMargin: Integer); |
![]() |
procedure PrepareResources; override; |
![]() |
procedure Print(const X, Y: Single; const Color: TCastleColor; const S: string); override; |
![]() |
function TextWidth(const S: string): Single; override; |
![]() |
function TextHeight(const S: string): Single; override; |
![]() |
function TextHeightBase(const S: string): Single; override; |
![]() |
function TextMove(const S: string): TVector2; override; |
Description
Methods
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure Load(AImage: TCastleImage; const AImageCols, AImageRows, ACharMargin, ACharDisplayMargin: Integer); |
|
Load font from given image. Parameters
| |
![]() |
procedure PrepareResources; override; |
![]() |
procedure Print(const X, Y: Single; const Color: TCastleColor; const S: string); override; |
![]() |
function TextWidth(const S: string): Single; override; |
![]() |
function TextHeight(const S: string): Single; override; |
![]() |
function TextHeightBase(const S: string): Single; override; |
![]() |
function TextMove(const S: string): TVector2; override; |
Generated by PasDoc 0.16.0.
