FlameText constructor

FlameText(
  1. String text, {
  2. TextStyle? textStyle,
  3. Color? color,
  4. TextAlign textAlign = TextAlign.center,
})

Implementation

FlameText(
  String text, {
  TextStyle? textStyle,
  Color? color,
  this.textAlign = TextAlign.center,
})  : textPainter = TextPainter(
        text: TextSpan(
          text: text,
          style: textStyle ??
              TextStyle(
                color: color ?? Colors.black,
              ),
        ),
        textDirection: TextDirection.ltr,
        textAlign: textAlign,
      ),
      assert(textStyle == null || color == null);