C# Class Axiom.Fonts.Font

This class is simply a way of getting a font texture into the engine and to easily retrieve the texture coordinates required to accurately render them. Fonts can either be loaded from precreated textures, or the texture can be generated using a truetype font. You can either create the texture manually in code, or you can use an XML font script to define it (probably more practical since you can reuse the definition more easily)
This class extends both Resource and ManualResourceLoader since it is both a resource in it's own right, but it also provides the manual load implementation for the Texture it creates.
Inheritance: Axiom.Core.Resource, IManualResourceLoader
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Méthodes publiques

Méthode Description
Font ( ResourceManager parent, string name, System.UInt64 handle, string group ) : System

Constructor, should be called through FontManager.Create().

Font ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader ) : System
LoadResource ( Axiom.Core.Resource resource ) : void

Méthodes protégées

Méthode Description
calculateSize ( ) : int
createTexture ( ) : void
load ( ) : void
unload ( ) : void

Private Methods

Méthode Description
GetGlyphAspectRatio ( char c ) : float
GetGlyphTexCoords ( UInt32 c, Real &u1, Real &v1, Real &u2, Real &v2 ) : void
SetGlyphTexCoords ( UInt32 c, Real u1, Real v1, Real u2, Real v2 ) : void
SetGlyphTexCoords ( UInt32 c, Real u1, Real v1, Real u2, Real v2, Real aspect ) : void
StrBBox ( string text, float char_height, Axiom.Graphics.RenderWindow window ) : Pair

Returns the size in pixels of a box that could contain the whole string.

Method Details

Font() public méthode

Constructor, should be called through FontManager.Create().
public Font ( ResourceManager parent, string name, System.UInt64 handle, string group ) : System
parent Axiom.Core.ResourceManager
name string
handle System.UInt64
group string
Résultat System

Font() public méthode

public Font ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader ) : System
parent Axiom.Core.ResourceManager
name string
handle System.UInt64
group string
isManual bool
loader IManualResourceLoader
Résultat System

LoadResource() public méthode

public LoadResource ( Axiom.Core.Resource resource ) : void
resource Axiom.Core.Resource
Résultat void

calculateSize() protected méthode

protected calculateSize ( ) : int
Résultat int

createTexture() protected méthode

protected createTexture ( ) : void
Résultat void

load() protected méthode

protected load ( ) : void
Résultat void

unload() protected méthode

protected unload ( ) : void
Résultat void