TextureAtom.int constructor

TextureAtom.int(
  1. int x1,
  2. int y1,
  3. int x2,
  4. int y2,
  5. String textureName,
  6. int tl,
  7. int th,
)

Implementation

factory TextureAtom.int(
    int x1, int y1, int x2, int y2, String textureName, int tl, int th) {
  final tx1 = x1 / tl;
  final tx2 = x2 / tl;
  final ty1 = y1 / th;
  final ty2 = y2 / th;
  final len = (x2 - x1).abs();
  final hgt = (y2 - y1).abs();
  final ix1 = x1;
  final iy1 = y1;
  final ix2 = x2;
  final iy2 = y2;
  return TextureAtom(tx1, ty1, tx2, ty2, textureName, tl, th,
      ix1: ix1, iy1: iy1, ix2: ix2, iy2: iy2, len: len, hgt: hgt);
}