mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
Adding SimpleGame, EmbeddedGameWidget and animationAsWidget to allow for easy integration of flame with non-game flutter apps, plus docs improved, minor fixes
This commit is contained in:
@ -95,8 +95,8 @@ abstract class PositionComponent extends Component {
|
||||
canvas.translate(x, y);
|
||||
|
||||
canvas.rotate(angle);
|
||||
double dx = - anchor.relativePosition.dx * width;
|
||||
double dy = - anchor.relativePosition.dy * height;
|
||||
double dx = -anchor.relativePosition.dx * width;
|
||||
double dy = -anchor.relativePosition.dy * height;
|
||||
canvas.translate(dx, dy);
|
||||
}
|
||||
}
|
||||
@ -109,9 +109,11 @@ class SpriteComponent extends PositionComponent {
|
||||
|
||||
SpriteComponent();
|
||||
|
||||
SpriteComponent.square(double size, String imagePath) : this.rectangle(size, size, imagePath);
|
||||
SpriteComponent.square(double size, String imagePath)
|
||||
: this.rectangle(size, size, imagePath);
|
||||
|
||||
SpriteComponent.rectangle(double width, double height, String imagePath) : this.fromSprite(width, height, new Sprite(imagePath));
|
||||
SpriteComponent.rectangle(double width, double height, String imagePath)
|
||||
: this.fromSprite(width, height, new Sprite(imagePath));
|
||||
|
||||
SpriteComponent.fromSprite(double width, double height, this.sprite) {
|
||||
this.width = width;
|
||||
|
||||
Reference in New Issue
Block a user