AnimatedTexture.fromTextures constructor

AnimatedTexture.fromTextures(
  1. List<Texture> frames, {
  2. double frameTime = 1 / 60,
  3. bool loop = false,
})

Implementation

AnimatedTexture.fromTextures(List<Texture> frames, {this.frameTime = 1 / 60, this.loop = false})
    : assert(frames.isNotEmpty),
      _frames = frames,
      _currentFrameTime = 0,
      _currentFrameIndex = 0,
      super.fromImage(
        frames[0].image,
        position: frames[0].position,
        size: frames[0].size,
        trimOffset: frames[0].trimOffset,
        trimSize: frames[0].trimSize,
      );