Animation API getting better but now need to resolve how it works with the frames.
This commit is contained in:
parent
785d0240da
commit
d4e79f1d3d
7 changed files with 70 additions and 45 deletions
|
|
@ -160,11 +160,11 @@ TEST_CASE("confirm transition changes work", "[animation-new]") {
|
|||
textures::init();
|
||||
animation::init();
|
||||
|
||||
auto sprite = *textures::get_sprite("rat_king_boss").sprite;
|
||||
auto pos = sprite.getPosition();
|
||||
auto scale = sprite.getScale();
|
||||
auto anim = crafter();
|
||||
|
||||
sf::Vector2f pos{10,10};
|
||||
sf::Vector2f scale{0.6, 0.6};
|
||||
|
||||
// also testing that onFrame being null means it's not run
|
||||
REQUIRE(anim.onFrame == nullptr);
|
||||
|
||||
|
|
@ -175,12 +175,12 @@ TEST_CASE("confirm transition changes work", "[animation-new]") {
|
|||
sf::Time start;
|
||||
sf::Time delta;
|
||||
|
||||
|
||||
while(anim.playing) {
|
||||
start = clock.getElapsedTime();
|
||||
|
||||
anim.update();
|
||||
anim.motion(pos, scale, 0.8f);
|
||||
anim.motion(sprite, pos, scale);
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
fmt::println("POSITION: {},{}; SCALE: {},{}; current: {}; subframe: {}",
|
||||
pos.x, pos.y, scale.x, scale.y, anim.$sequence.current, anim.$sequence.subframe);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue