mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 12:28:03 +08:00
formating and fixing warnings
This commit is contained in:
@ -61,8 +61,8 @@ class Animation {
|
|||||||
int amount, {
|
int amount, {
|
||||||
double textureX = 0.0,
|
double textureX = 0.0,
|
||||||
double textureY = 0.0,
|
double textureY = 0.0,
|
||||||
double textureWidth = null,
|
double textureWidth,
|
||||||
double textureHeight = null,
|
double textureHeight,
|
||||||
double stepTime = 0.1,
|
double stepTime = 0.1,
|
||||||
}) {
|
}) {
|
||||||
this.frames = new List<Frame>(amount);
|
this.frames = new List<Frame>(amount);
|
||||||
@ -85,8 +85,8 @@ class Animation {
|
|||||||
List<double> stepTimes, {
|
List<double> stepTimes, {
|
||||||
double textureX = 0.0,
|
double textureX = 0.0,
|
||||||
double textureY = 0.0,
|
double textureY = 0.0,
|
||||||
double textureWidth = null,
|
double textureWidth,
|
||||||
double textureHeight = null,
|
double textureHeight,
|
||||||
}) {
|
}) {
|
||||||
this.frames = new List<Frame>(amount);
|
this.frames = new List<Frame>(amount);
|
||||||
for (var i = 0; i < amount; i++) {
|
for (var i = 0; i < amount; i++) {
|
||||||
@ -108,7 +108,7 @@ class Animation {
|
|||||||
bool get isLastFrame => currentIndex == frames.length - 1;
|
bool get isLastFrame => currentIndex == frames.length - 1;
|
||||||
|
|
||||||
/// Sets a different step time to each frame. The sizes of the arrays must match.
|
/// Sets a different step time to each frame. The sizes of the arrays must match.
|
||||||
void set variableStepTimes(List<double> stepTimes) {
|
set variableStepTimes(List<double> stepTimes) {
|
||||||
assert(stepTimes.length == frames.length);
|
assert(stepTimes.length == frames.length);
|
||||||
for (int i = 0; i < frames.length; i++) {
|
for (int i = 0; i < frames.length; i++) {
|
||||||
frames[i].stepTime = stepTimes[i];
|
frames[i].stepTime = stepTimes[i];
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:flutter/src/painting/text_painter.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import 'component.dart';
|
import 'component.dart';
|
||||||
import 'resizable.dart';
|
import 'resizable.dart';
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flame/components/component.dart';
|
import 'package:flame/components/component.dart';
|
||||||
@ -77,7 +78,5 @@ class TiledComponent extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void update(double t) {
|
void update(double t) {}
|
||||||
// TODO: implement update
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,8 @@ class Util {
|
|||||||
/// Use this in order to get it to work in case your app also contains other widgets.
|
/// Use this in order to get it to work in case your app also contains other widgets.
|
||||||
void addGestureRecognizer(GestureRecognizer recognizer) {
|
void addGestureRecognizer(GestureRecognizer recognizer) {
|
||||||
if (GestureBinding.instance == null) {
|
if (GestureBinding.instance == null) {
|
||||||
throw new Exception("GestureBinding is not initialized yet, this probably happened because addGestureRecognizer was called before the runApp method");
|
throw new Exception(
|
||||||
|
"GestureBinding is not initialized yet, this probably happened because addGestureRecognizer was called before the runApp method");
|
||||||
}
|
}
|
||||||
|
|
||||||
GestureBinding.instance.pointerRouter.addGlobalRoute((PointerEvent e) {
|
GestureBinding.instance.pointerRouter.addGlobalRoute((PointerEvent e) {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user