Fixed with regards to the comments

This commit is contained in:
Lukas Klingsbo
2020-09-30 20:49:19 +02:00
parent 49029db6ac
commit 0f9fc2c60e
20 changed files with 74 additions and 78 deletions

View File

@ -25,7 +25,8 @@ class Selector extends SpriteComponent {
bool show = false;
Selector(double s)
: super.fromSprite(s, s, Sprite('selector.png', width: 32, height: 32));
: super.fromSprite(
Vector2.all(s), Sprite('selector.png', size: Vector2.all(32.0)));
@override
void render(Canvas canvas) {
@ -81,6 +82,6 @@ class MyGame extends BaseGame with MouseMovementDetector {
final screenPosition = event.position.toVector2();
final block = base.getBlock(screenPosition);
selector.show = base.containsBlock(block);
selector.setPosition(base.getBlockPosition(block) + topLeft);
selector.position = base.getBlockPosition(block) + topLeft;
}
}