animation improvemenets
This commit is contained in:
parent
16c10a5c4a
commit
f842a445d7
2 changed files with 13 additions and 13 deletions
|
|
@ -24,8 +24,7 @@ int main() {
|
|||
element.UpdatePosition(window);
|
||||
|
||||
Animation<std::tuple<std::int_fast32_t>> anim({
|
||||
{std::chrono::seconds(0), FractionalToMapped(-0.5)},
|
||||
{std::chrono::seconds(5), FractionalToMapped(1.5)}
|
||||
{std::chrono::seconds(5), FractionalToMapped(-0.5), FractionalToMapped(1.5)},
|
||||
});
|
||||
|
||||
anim.Start(std::chrono::high_resolution_clock::now());
|
||||
|
|
@ -34,7 +33,7 @@ int main() {
|
|||
std::tuple<std::int_fast32_t> value = anim.Play(time.now);
|
||||
element.anchorX = std::get<0>(value);
|
||||
element.UpdatePosition(window);
|
||||
if(anim.currentFrame == anim.keyframes.size()-1) {
|
||||
if(anim.currentFrame == anim.keyframes.size()) {
|
||||
anim.Start(time.now);
|
||||
}
|
||||
window.LogTiming();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue