SFML community forums

Bindings - other languages => General => Topic started by: Daniel on July 06, 2020, 12:52:17 am

Title: How to delay the process of drawing
Post by: Daniel on July 06, 2020, 12:52:17 am
Hello! I've created an interface in which I am drawing some lines on the window. My question is how can I slow down this process of drawing (like printing them one by one in real time)? Would ctime / chrono libraries be useful or is there something else that you can do with SFML?
Title: Re: How to delay the process of drawing
Post by: Hapax on July 06, 2020, 11:05:20 pm
Chrono would be very useful for timing to use for the animations. SFML also provides a simple-to-use clock (https://www.sfml-dev.org/tutorials/2.5/system-time.php), which can be very useful for everything other than extremely advanced time manipulations.
You may also find some interest in Kairos (https://github.com/Hapaxia/Kairos/wiki), a timing library that uses chrono. One thing provides clocks that can be paused, slowed, reversed etc..
For animations where you can control in a similar fashion to time-line animation software, you could find some use of Plinth (https://github.com/Hapaxia/Plinth/wiki), maybe especially the SFML module, although the main timeline stuff is in the main module (SFML part not needed). I used it exclusively to animate everything in the Selba Ward example video (https://www.youtube.com/watch?v=Yjs-oRhn2fE)
(click to show/hide)

With all that said, you'll have to be more specific in your problem if you want a more specific answer/help, sorry.
Title: Re: How to delay the process of drawing
Post by: Daniel on July 10, 2020, 12:21:46 am
Cool! Thanks for your answer :D