GridComponent constructor
GridComponent({
- required List<
PositionComponent> children, - required Vector2 childSize,
- Vector2? spacing,
- required Vector2 size,
- required Vector2 position,
Creates a GridComponent with the given parameters.
children is the list of child components to arrange.
childSize specifies the size of each child component.
spacing specifies the spacing between child components (optional).
size specifies the size of the grid.
position specifies the position of the grid.
Implementation
GridComponent({
required List<PositionComponent> children,
required this.childSize,
Vector2? spacing,
required Vector2 size,
required Vector2 position,
}) : spacing = spacing ?? Vector2.all(0),
childrenComponents = children,
super(size: size, position: position);