TGUI
0.10-beta
|
Wrapper for durations. More...
#include <TGUI/Duration.hpp>
Public Member Functions | |
TGUI_CONSTEXPR | Duration () |
Creates an zero-length duration. | |
template<typename Rep , typename Period > | |
TGUI_CONSTEXPR | Duration (std::chrono::duration< Rep, Period > duration) |
Creates the duration from any kind of std::chrono::duration. | |
TGUI_CONSTEXPR | Duration (int milliseconds) |
Creates the duration from a given amount of milliseconds. More... | |
Duration (sf::Time duration) | |
Creates the duration from an sf::Time instance. | |
TGUI_CONSTEXPR float | asSeconds () const |
Returns the duration in seconds. | |
TGUI_CONSTEXPR | operator std::chrono::nanoseconds () const |
Convert the duration to std::chrono::nanoseconds. | |
template<typename Rep , typename Period > | |
TGUI_CONSTEXPR | operator std::chrono::duration< Rep, Period > () const |
Convert the duration to std::chrono::duration. | |
operator sf::Time () const | |
Convert the duration to sf::Time. | |
Wrapper for durations.
You do not have to use class directly in your code unless you want to store the duration. Functions taking tgui::Duration as parameter can be directly passed arguments like:
|
inline |
Creates the duration from a given amount of milliseconds.
milliseconds | Amount of milliseconds to store in the duration |