$applyPaint method

  1. @override
void $applyPaint(
  1. Canvas canvas
)
override

(Internal usage) Applies the paint to the given canvas for this GSprite. The graphics will be used to paint the canvas, and if this GSprite has child display objects, their paint will also be applied.

The canvas parameter is the ui.Canvas object to apply the paint to.

Implementation

@override
void $applyPaint(ui.Canvas canvas) {
  if (!$hasVisibleArea) return;
  _graphics?.alpha = worldAlpha;
  _graphics?.paint(canvas);
  if (hasChildren) {
    super.$applyPaint(canvas);
  }
}