SFML community forums
General => Feature requests => Topic started by: MrOnlineCoder on March 06, 2017, 07:39:42 pm
-
Hello. Very often, in games timers are used. For spell countdown, turn duration, bomb timer, etc... It will be very convinient if SFML would have a timer class. It can be similiar to sf::Clock, but it should go downwards, and it can call a function on end or fire up an event.
Thanks,
MrOnlineCoder
-
It would probably be fairly easy to just create your own timer class on top of sf::Clock. If you don't want to do it yourself, I think Hapax's Kairos library (https://github.com/Hapaxia/Kairos/) has one you can use.
-
I think it is not a rational way to include a library just to use one class. And every feature in this forum can be written by yourself in class ;)
-
It's a rational for us. We want to provide low-ish level functionalities with a simple API on to of which you can build whatever you want.
If a feature solely consists of using SFML functions to create a new class, then it's not something we're very inclined to include, because that class can be built by anyone else on top of SFML.
If a feature however requires changes to SFML classes itself or requires the use of OS APIs, then it's something we might think more about including it in SFML, since it can't just be built on top of SFML.
Don't forget that SFML is not an engine nor a framework.
Thor's StopWatch (http://www.bromeon.ch/libraries/thor/documentation/v2.1/classthor_1_1_stop_watch.html) class is quite nice as well, plus when you include Thor, you'll also get access to a lot of other useful clsses.
-
I think Hapax's Kairos library (https://github.com/Hapaxia/Kairos/) has one you can use.
I think it is not a rational way to include a library just to use one class.
Then don't just use one class. It also has a Timestep class (https://github.com/Hapaxia/Kairos/wiki/Timestep) and a clock that can have its speed changed including backwards: Continuum. ;)
And every feature in this forum can be written by yourself in class ;)
Not true. Try to add native window menus using an SFML window :P