TextPaint class
It does not hold information regarding the position of the text to be rendered, nor does it contain the text itself (the string). To use that information, use the TextComponent, which uses TextPaint.
- Inheritance
-
- Object
- TextRenderer
- TextPaint
Constructors
- TextPaint({TextStyle? style, TextDirection? textDirection})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → TextStyle
-
final
- textDirection → TextDirection
-
finalinherited
Methods
-
copyWith(
TextStyle transform(TextStyle), {TextDirection? textDirection}) → TextPaint -
measureText(
String text) → Vector2 -
Given a
textString, returns a Vector2 with the size of thattexthas.inherited -
measureTextHeight(
String text) → double -
Given a
textString, returns the height of thattext.override -
measureTextWidth(
String text) → double -
Given a
textString, returns the width of thattext.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
Canvas canvas, String text, Vector2 p, {Anchor anchor = Anchor.topLeft}) → void -
Renders a given
textin a given positionpositionusing the providedcanvasandanchor.override -
toString(
) → String -
A string representation of this object.
inherited
-
toTextPainter(
String text) → TextPainter - Returns a TextPainter that allows for text rendering and size measuring.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultTextStyle → const TextStyle