Skip to content

Commit

Permalink
feat: Add missing optional priority to SpriteBodyComponent (#1404)
Browse files Browse the repository at this point in the history
* Add missing optional priority to SpriteBodyComponent

Gives you the option to set the priority directly when creating the component.

* Add optional parameter priority

Adds priority as an optional parameter

* removed wrong trailing comma

Added a comma at the wrong position.
  • Loading branch information
KurtLa authored Feb 26, 2022
1 parent 5b58f87 commit a000eb1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/flame_forge2d/lib/sprite_body_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ abstract class SpriteBodyComponent<T extends Forge2DGame>
/// body that is create in createBody()
SpriteBodyComponent(
Sprite sprite,
Vector2 spriteSize,
) : super(
positionComponent: SpriteComponent(size: spriteSize, sprite: sprite),
Vector2 spriteSize, {
int? priority,
}) : super(
positionComponent: SpriteComponent(
size: spriteSize,
sprite: sprite,
priority: priority,
),
size: spriteSize,
);
}

0 comments on commit a000eb1

Please sign in to comment.