SimpleFlips constructor

SimpleFlips(
  1. int angle,
  2. int cos,
  3. int sin, {
  4. required bool flip,
})

Tiled represents all flips and rotation using three possible flips: horizontal, vertical and diagonal. This class converts that representation to a simpler one, that uses one angle (with pi/2 steps) and one flip (horizontal). All vertical flips are represented as horizontal flips + 180ยบ. Further reference: https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tile-flipping.

cos and sin are the cosine and sine of the rotation respectively, and and are provided for simple calculation with RSTransform. Further reference: https://api.flutter.dev/flutter/dart-ui/RSTransform/RSTransform.html

Implementation

SimpleFlips(this.angle, this.cos, this.sin, {required this.flip});