mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 04:18:25 +08:00
formatting files
This commit is contained in:
committed by
Erick (CptBlackPixel)
parent
411a39fd72
commit
51d259038f
@ -29,7 +29,8 @@ class TiledGame extends BaseGame {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (TmxObject obj in obj.tmxObjects) {
|
for (TmxObject obj in obj.tmxObjects) {
|
||||||
final Rect rect = Rect.fromLTWH(obj.x.toDouble(), obj.y.toDouble(), 30.0, 30.0);
|
final Rect rect =
|
||||||
|
Rect.fromLTWH(obj.x.toDouble(), obj.y.toDouble(), 30.0, 30.0);
|
||||||
final position = Position(obj.x.toDouble(), obj.y.toDouble());
|
final position = Position(obj.x.toDouble(), obj.y.toDouble());
|
||||||
a.getSprite().renderPosition(canvas, position);
|
a.getSprite().renderPosition(canvas, position);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,8 +69,10 @@ class TiledComponent extends Component {
|
|||||||
final image = images[tile.image.source];
|
final image = images[tile.image.source];
|
||||||
|
|
||||||
final rect = tile.computeDrawRect();
|
final rect = tile.computeDrawRect();
|
||||||
final src = Rect.fromLTWH(rect.left.toDouble(), rect.top.toDouble(), rect.width.toDouble(), rect.height.toDouble());
|
final src = Rect.fromLTWH(rect.left.toDouble(), rect.top.toDouble(),
|
||||||
final dst = Rect.fromLTWH(tile.x.toDouble(), tile.y.toDouble(), rect.width.toDouble(), rect.height.toDouble());
|
rect.width.toDouble(), rect.height.toDouble());
|
||||||
|
final dst = Rect.fromLTWH(tile.x.toDouble(), tile.y.toDouble(),
|
||||||
|
rect.width.toDouble(), rect.height.toDouble());
|
||||||
|
|
||||||
c.drawImageRect(image, src, dst, paint);
|
c.drawImageRect(image, src, dst, paint);
|
||||||
});
|
});
|
||||||
@ -78,10 +80,12 @@ class TiledComponent extends Component {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void update(double t) {}
|
void update(double t) {}
|
||||||
ObjectGroup getObjectLayerByName(String name) {
|
|
||||||
|
ObjectGroup getObjectGroupLayerByName(String name) {
|
||||||
if (!loaded()) {
|
if (!loaded()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return map.objectGroups.firstWhere((objectGroup) => objectGroup.name == name);
|
return map.objectGroups
|
||||||
|
.firstWhere((objectGroup) => objectGroup.name == name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user