Class TextService
Inheritance
System.Object
TextService
Syntax
public static class TextService
Methods
AddGlyph(EntityManager, ref Entity, UInt32, Single, Single, Single, Single, Single, Rect)
Adds a glyph to a BitmapFont
Declaration
public static void AddGlyph(EntityManager mgr, ref Entity fontEntity, uint character, float bearingX, float bearingY, float advance, float width, float height, Rect characterRegion)
Parameters
Type |
Name |
Description |
EntityManager |
mgr |
|
Entity |
fontEntity |
|
System.UInt32 |
character |
|
System.Single |
bearingX |
|
System.Single |
bearingY |
|
System.Single |
advance |
|
System.Single |
width |
|
System.Single |
height |
|
Rect |
characterRegion |
|
CreateBitmapFont(EntityManager, ref Entity, Single, Single, Single)
Creates a BitmapFont entity.
Declaration
public static Entity CreateBitmapFont(EntityManager mgr, ref Entity textureAtlasImg, float size, float ascent, float descent)
Parameters
Type |
Name |
Description |
EntityManager |
mgr |
|
Entity |
textureAtlasImg |
|
System.Single |
size |
|
System.Single |
ascent |
|
System.Single |
descent |
|
Returns
CreateNativeFont(EntityManager, FontName, String, Single)
Creates a NativeFont entity.
Declaration
public static Entity CreateNativeFont(EntityManager mgr, FontName fontName, string ttfFileName, float worldUnitsToPt)
Parameters
Type |
Name |
Description |
EntityManager |
mgr |
|
FontName |
fontName |
|
System.String |
ttfFileName |
|
System.Single |
worldUnitsToPt |
|
Returns
CreateTextWithBitmapFont(EntityManager, ref Entity, String, Single, Color, BlendOp, float2)
Creates a text to render with a BitmapFont.
Declaration
public static Entity CreateTextWithBitmapFont(EntityManager mgr, ref Entity fontEntity, string text, float size, Color color, BlendOp blending, float2 pivot)
Parameters
Type |
Name |
Description |
EntityManager |
mgr |
|
Entity |
fontEntity |
|
System.String |
text |
|
System.Single |
size |
|
Color |
color |
|
BlendOp |
blending |
|
float2 |
pivot |
|
Returns
CreateTextWithNativeFont(EntityManager, ref Entity, String, Single, Boolean, Int32, Color, BlendOp, float2)
Creates text to render with a NativeFont.
Declaration
public static Entity CreateTextWithNativeFont(EntityManager mgr, ref Entity fontEntity, string text, float size, bool italic, int weight, Color color, BlendOp blending, float2 pivot)
Parameters
Type |
Name |
Description |
EntityManager |
mgr |
|
Entity |
fontEntity |
|
System.String |
text |
|
System.Single |
size |
|
System.Boolean |
italic |
|
System.Int32 |
weight |
|
Color |
color |
|
BlendOp |
blending |
|
float2 |
pivot |
|
Returns
GetCharacterInfo(DynamicBuffer<CharacterInfoBuffer>, UInt32, out CharacterInfo)
Get CharacterInfo value of a UTF-32 code point. Will return a default value if not present.
Declaration
public static bool GetCharacterInfo(DynamicBuffer<CharacterInfoBuffer> data, uint character, out CharacterInfo outCharacterInfo)
Parameters
Returns
Type |
Description |
System.Boolean |
True if the character was found.
|
GetFontFamilyName(FontName)
Returns a string descriptor of a FontName.
Declaration
public static string GetFontFamilyName(FontName fontName)
Parameters
Returns
Type |
Description |
System.String |
|