formatting files

This commit is contained in:
renato.soares
2019-08-09 14:31:19 -03:00
committed by Erick (CptBlackPixel)
parent 411a39fd72
commit 51d259038f
2 changed files with 10 additions and 5 deletions

View File

@ -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);
} }

View File

@ -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);
} }
} }