From 54ab44e3508d526be6275378e5979290ec188d6f Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Mon, 2 Dec 2024 10:18:08 +0100 Subject: comments i animator and sprite. added sprite indepentdent scale and angle --- src/crepe/api/Animator.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/crepe/api/Animator.cpp') diff --git a/src/crepe/api/Animator.cpp b/src/crepe/api/Animator.cpp index 7fe49ee..0b7e86d 100644 --- a/src/crepe/api/Animator.cpp +++ b/src/crepe/api/Animator.cpp @@ -24,3 +24,20 @@ Animator::Animator(game_object_id_t id, Sprite & ss, int row, int col, int col_a = static_cast(this->spritesheet.mask.w) / this->spritesheet.mask.h; } Animator::~Animator() { dbg_trace(); } + +void Animator::loop() { this->looping = true; } +void Animator::play() { this->active = true; } +void Animator::pause() { this->active = false; } +void Animator::stop() { + this->active = false; + this->curr_col = 0; + this->curr_row = 0; +} +void Animator::set_fps(int fps) { this->fps = fps; } +void Animator::set_cycle_range(int start, int end) { + this->cycle_start = start, this->cycle_end = end; +} +void Animator::set_anim(int col) { + this->curr_row = 0; + this->curr_col = col; +} -- cgit v1.2.3