FlatRedBall.Graphics.TextManager.AddText

Introduction The AddText method is used to either add an existing Text instance to the engine, or to both create and add a Text to the engine. Code Example The following code adds a Text object to the engine. Text text object will be automatically visible and updated by the engine. Text textInstance = TextManager.AddText("Hello");

FlatRedBall.Graphics.TextManager.RemoveText

Introduction The RemoveText method will remove the argument Text instance from the engine so it will no longer be drawn or have every-frame management applied. RemoveText also removes the Text from any PositionedObjectList that it is a part of (assuming a two-way relationship). Code Example // Assuming text is a valid Text which has been[…]

FlatRedBall.Graphics.TextManager.GetWidth

Introduction The GetWidth method returns the width of a piece of text. The GetWidth method returns the width of text, and can accept a variety of arguments. The overloads provide flexibility depending on how much information is needed. Overloads public static float GetWidth(string text) public static float GetWidth(string text, float spacing) public static float GetWidth(string[…]

FlatRedBall.Graphics.TextManager.FilterTexts

Introduction The FilterTexts property controls whether Texts are rendered. The TextManager can set this value and it will override the value set in the GraphicsOption’s TextureFilter property. Default Value The default for TextManager.FilterTexts is false, while the default value for the GraphicsOption’s TextureFilter is on (technically it’s an enumeration, but for simplicity we’ll say that[…]

FlatRedBall.Graphics.TextManager.AddToLayer

Code Example The following code creates a Text object and adds it to a layer. Layer layer = SpriteManager.AddLayer(); Text text = TextManager.AddText(“Hello”, layer); Alternatively the Text can be added to a Layer after AddText is called. The following code can also be used: Layer layer = SpriteManager.AddLayer(); Text text = TextManager.AddText(“Hello”); TextManager.AddToLayer(text, layer);

FlatRedBall.Graphics.IColorable.Alpha

Introduction The Alpha property represents the transparency (or opacity) of a given object. The default value is 1 (full opacity), and setting the value to 0 will make the object fully transparent. For FRB MDX users: Color and alpha values range from 0 to 255 in FlatRedBall MDX. Code Example The following code shows how[…]

SetPixelPerfectScale

Introduction SetPixelPerfectScale is a method which will adjust a Text object so that it renders pixel-perfect on the argument Camera. This method is automatically called on Text objects when added to the FlatRedBall.Graphics.TextManager. For more information on this behavior, see the AddText page. In the simplest situations this function will automatically be called for you[…]

TextManager

Introduction The TextManager is a static class which handles Text object addition, removal, and common behavior. The TextManager has many of the same methods (in concept) as the SpriteManager. The TextManager is automatically instantiated by FlatRedBall so you do not need to create an instance yourself. Text Object The TextManager provides numerous methods for for[…]

Layer

Introduction Layers can be used to control the order of visual objects on screen. Typically objects with a larger Z value will appear behind objects with smaller Z values, but this relationship is only true if the objects are on the same layer. Layers take priority over the Z value of objects when performing rendering.[…]

Text

Introduction The Text object provides functionality for drawing bitmap fonts in 2D and 3D space. It inherits from the PositionedObject class and shares many similarities with the Sprite class. Just as the Sprite class is associated with the SpriteManager, the Text object is associated with the TextManager. Note that most games which use Text do[…]