Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'armory3d:main' into gi_clipmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002e authored Apr 25, 2024
2 parents ae7765d + 99922de commit 1f95083
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Sources/iron/object/Tilesheet.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Tilesheet {
}
setFrame(action.start);
paused = false;
time = 0.0;
}

public function pause() {
Expand Down Expand Up @@ -100,16 +101,17 @@ class Tilesheet {
function setFrame(f: Int) {
frame = f;

var tx = frame % raw.tilesx;
var ty = Std.int(frame / raw.tilesx);
tileX = tx * (1 / raw.tilesx);
tileY = ty * (1 / raw.tilesy);

// Action end
if (frame >= action.end && action.start < action.end) {
if (frame > action.end && action.start < action.end) {
if (onActionComplete != null) onActionComplete();
if (action.loop) setFrame(action.start);
else paused = true;
return;
}

var tx = frame % raw.tilesx;
var ty = Std.int(frame / raw.tilesx);
tileX = tx * (1 / raw.tilesx);
tileY = ty * (1 / raw.tilesy);
}
}

0 comments on commit 1f95083

Please sign in to comment.