2022-12-10 05:06:01 +01:00
|
|
|
#region anomation class
|
|
|
|
function AnimationManager() constructor {
|
|
|
|
frames_total = 30;
|
|
|
|
current_frame = 0;
|
|
|
|
real_frame = 0;
|
|
|
|
framerate = 30;
|
|
|
|
is_playing = false;
|
|
|
|
frame_progress = false;
|
|
|
|
|
2022-12-23 04:45:52 +01:00
|
|
|
rendering = false;
|
2022-12-10 05:06:01 +01:00
|
|
|
playback = ANIMATOR_END.loop;
|
|
|
|
|
|
|
|
static setFrame = function(frame) {
|
2022-12-12 09:08:03 +01:00
|
|
|
var _c = current_frame;
|
2022-12-10 05:06:01 +01:00
|
|
|
frame = clamp(frame, 0, frames_total - 1);
|
|
|
|
real_frame = frame;
|
|
|
|
current_frame = round(frame);
|
2022-12-12 09:08:03 +01:00
|
|
|
|
|
|
|
if(_c != current_frame)
|
|
|
|
frame_progress = true;
|
2022-12-10 05:06:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region object
|
2022-12-19 13:35:30 +01:00
|
|
|
enum ANIMATOR_END {
|
|
|
|
loop,
|
|
|
|
stop
|
|
|
|
}
|
|
|
|
|
2022-12-10 05:06:01 +01:00
|
|
|
globalvar ANIMATOR;
|
|
|
|
ANIMATOR = new AnimationManager();
|
|
|
|
#endregion
|