Click or drag to resize
Ab4d.SharpEngine logo

BitmapTextCreatorCreateTextNode Method

CreateTextNode creates a SceneNode (MeshModelNode or GroupNode) with the specified text and at the specified position, direction and size.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public SceneNode CreateTextNode(
	string text,
	Vector3 position,
	PositionTypes positionType,
	Vector3 textDirection,
	Vector3 upDirection,
	float fontSize,
	Color4 textColor,
	bool isSolidColorMaterial = true,
	float maxWidth = 0f,
	float fontStretch = 1f,
	string? name = null
)

Parameters

text  String
text to render (can have multiple lines)
position  Vector3
position as Vector3
positionType  PositionTypes
type of position
textDirection  Vector3
text direction as Vector3
upDirection  Vector3
text up direction as Vector3
fontSize  Single
font size
textColor  Color4
text color as Color4
isSolidColorMaterial  Boolean  (Optional)
when true (by default) then solid color material is used. In this case the text will be always rendered with the specified textColor and will not be shaded by lighting.
maxWidth  Single  (Optional)
when bigger than 0 (0 by default) then it specifies the max text width - if wider, then text is automatically wrapped into a new line after the last word (or character if the word is longer then maxWidth).
fontStretch  Single  (Optional)
amount of horizontal font stretch (1 by default does not stretch the font)
name  String  (Optional)
optional name

Return Value

SceneNode
SceneNode with the specified text and at the specified position, direction and size. When multiple MeshModelNode are needed to render the text, then GroupNode is returned; otherwise a single MeshModelNode is returned
See Also