Click or drag to resize
Ab4d.SharpEngine logo

BitmapFontMeasureText Method

Provides the size, in pixels, of the specified text when drawn with this font. When maxWidth is bigger then 0, then text is wrapped keep within the specified with.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public Vector2 MeasureText(
	string text,
	double maxWidth = -1
)

Parameters

text  String
The text to measure.
maxWidth  Double  (Optional)
The maximum width to warp the text; when zero or smaller (-1 by default), then the text in not wrapped.

Return Value

Vector2
The size in pixels, of text drawn with this font.
See Also