Click or drag to resize
Ab4d.SharpEngine logo

TextBlockFactory Class

TextBlockFactory is a helper class that can create text blocks with specified background and border. The TextBlockFactory can use the default SharpEngine's BitmapTextCreator (created by GetDefaultBitmapTextCreator(Scene)) or can be created by a custom BitmapTextCreator.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.UtilitiesTextBlockFactory

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class TextBlockFactory

The TextBlockFactory type exposes the following members.

Constructors
 NameDescription
Public methodTextBlockFactory(BitmapTextCreator) Constructor that will use the specified BitmapTextCreator.
Public methodTextBlockFactory(Scene) Constructor that will use the default BitmapTextCreator (get by GetDefaultBitmapTextCreator(Scene)).
Top
Properties
 NameDescription
Public propertyBackgroundColor Color4 that specifies the color of the background panel. When set to Color4.Transparent, then the background panel is not rendered. Default value is Transparent.
Public propertyBackgroundHorizontalPadding Float value that defines the horizontal padding of the background plane - how much bigger is the background plane. Default value is 8.
Public propertyBackgroundOffset Float that defined how far from the background plane the text will be. This prevents z-fighting artifacts (merging the text with the backgroun). Default value is 0.05. Increase this value if some artifacts are visible.
Public propertyBackgroundVerticalPadding Float value that defines the vertical padding of the background plane - how much bigger is the background plane. Default value is 4.
Public propertyBackMaterialColor Color4 that defines the background color of a BackMaterial for PlaneModelNode that is created to render background panel. When set to Color4.Transparent, then BackMaterial is set to null. Default value is Color4.Black.
Public propertyBorderColor Color4 that defines the color of the border. When set to Color4.Transparent, then the border is not rendered. Default value is Color4.Black.
Public propertyBorderThickness Float value that specifies the thickness of the border. When set to 0, then the border is not rendered. Default value is 0.
Public propertyFontSize Size of the font. 14 by default.
Public propertyIsSolidColorMaterial True when a SolidColorMaterial is used to render the text. In this case the text will be always rendered with the specified color and will not be shaded by lighting. True by default.
Public propertyTextColor Color4 of the text. Black by default.
Top
Methods
 NameDescription
Public methodCreateTextBlock(String, Vector3, Single, Single, String) CreateTextBlock that creates a GroupNode with text at the specified center position and text orientation. Color of the text, background and the border is specified with the properties in this class. To align the text to a specific position use the overload that takes position and positionType.
Public methodCreateTextBlock(String, Vector3, PositionTypes, Single, Single, String) CreateTextBlock that creates a GroupNode with text at the specified position, position type and text orientation. Color of the text, background and the border is specified with the properties in this class.
Public methodCreateTextBlock(Vector3, PositionTypes, String, Vector3, Vector3, String) CreateTextBlock that creates a GroupNode with text at the specified position, position type and text orientation. Color of the text, background and the border is specified with the properties in this class.
Top
See Also