RectangleComponent constructor

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

Implementation

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