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");


Introduction The NewlineDistance property sets the amount of spacing between lines on a Text object. This value is set according to the Camera/Layer settings automatically when the Text is added to managers, but it can be modified after the fact to adjust spacing. Code Example (2D Camera/Layer) The default setup for FlatRedBall is to be[…]


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[…]


Introduction The AdjustPositionForPixelPerfectDrawing method tells the FlatRedBall Engine to attempt to offset Text objects so that they do not render in-between pixels. This value defaults to true, and in most cases you do not need to adjust it. When to adjust AdjustPositionForPixelPerfectDrawing AdjustPositionForPixelPerfectDrawing should be turned off if FlatRedBall is not properly adjusting your Text[…]


Introduction The NumberOfLines property returns the number of lines that the Text object will occupy when rendering. this value corresponds to the number of newline characters in the text object (‘\n’). Newline characters can be added manually to the DisplayText property, by calling FlatRedBall.Graphics.Text.InsertNewLines, or automatically according to the Text’s FlatRedBall.Graphics.Text.MaxWidthBehavior.


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[…]


Introduction The MaxWidthBehavior controls how the Text object displays its DisplayText when it is longer than the MaxWidth. MaxWidthBehavior is an enumeration. Available values are: Chop Wrap The default behavior is Chop. Code Example The following code creates 2 Text objects. It assumes a 3D camera. Text clampText = TextManager.AddText( “Hello I am some long[…]


Introduction ApplyColorOperation is a method which can be used to modify an ImageData using the same ColorOperation and Red,Green,Blue values that are present in the IColorable interface which is implemented by common FlatRedball objects such as Sprite and Text. ApplyColorOperation modifies the data stored in an ImageData permanently – it cannot be undone. Code Example[…]


Introduction The MaxWidth value controls the available area that the Text object can render text inside. The Text object will either wrap or clamp text according to its MaxWidthBehavior. Code Example Text text = TextManager.AddText(""); text.DisplayText = "Hello, I am some really long text that will wrap"; text.MaxWidth = 60; text.MaxWidthBehavior = MaxWidthBehavior.Wrap;


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[…]