RectangleComponent.square constructor

RectangleComponent.square({
  1. double size = 0,
  2. Vector2? position,
  3. Vector2? scale,
  4. double? angle,
  5. Anchor? anchor,
  6. int? priority,
  7. Paint? paint,
  8. List<Paint>? paintLayers,
  9. Iterable<Component>? children,
  10. ComponentKey? key,
})

Implementation

RectangleComponent.square({
  double size = 0,
  super.position,
  super.scale,
  super.angle,
  super.anchor,
  super.priority,
  super.paint,
  super.paintLayers,
  super.children,
  super.key,
}) : super(sizeToVertices(Vector2.all(size), anchor)) {
  this.size.addListener(
        () => refreshVertices(
          newVertices: sizeToVertices(this.size, anchor),
          shrinkToBoundsOverride: false,
        ),
      );
}