Click or drag to resize
Ab4d.SharpEngine logo

BitmapTextCreatorGetTextSize Method

Returns the size of the specified text.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.1.9680+a1b1e43de1ad9a7e35472c33948d688d7b40ef79
Syntax
C#
public Vector2 GetTextSize(
	string? text,
	float fontSize,
	float maxWidth = 0f,
	float fontStretch = 1f
)

Parameters

text  String
text to measure
fontSize  Single
font size
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)

Return Value

Vector2
size of the specified text
See Also