|
(Note that these are not member functions.)
|
| Time | seconds (float amount) |
| | Construct a time value from a number of seconds. More...
|
| |
| Time | milliseconds (Int32 amount) |
| | Construct a time value from a number of milliseconds. More...
|
| |
| Time | microseconds (Int64 amount) |
| | Construct a time value from a number of microseconds. More...
|
| |
| bool | operator== (Time left, Time right) |
| | Overload of == operator to compare two time values. More...
|
| |
| bool | operator!= (Time left, Time right) |
| | Overload of != operator to compare two time values. More...
|
| |
| bool | operator< (Time left, Time right) |
| | Overload of < operator to compare two time values. More...
|
| |
| bool | operator> (Time left, Time right) |
| | Overload of > operator to compare two time values. More...
|
| |
| bool | operator<= (Time left, Time right) |
| | Overload of <= operator to compare two time values. More...
|
| |
| bool | operator>= (Time left, Time right) |
| | Overload of >= operator to compare two time values. More...
|
| |
| Time | operator- (Time right) |
| | Overload of unary - operator to negate a time value. More...
|
| |
| Time | operator+ (Time left, Time right) |
| | Overload of binary + operator to add two time values. More...
|
| |
| Time & | operator+= (Time &left, Time right) |
| | Overload of binary += operator to add/assign two time values. More...
|
| |
| Time | operator- (Time left, Time right) |
| | Overload of binary - operator to subtract two time values. More...
|
| |
| Time & | operator-= (Time &left, Time right) |
| | Overload of binary -= operator to subtract/assign two time values. More...
|
| |
| Time | operator* (Time left, float right) |
| | Overload of binary * operator to scale a time value. More...
|
| |
| Time | operator* (Time left, Int64 right) |
| | Overload of binary * operator to scale a time value. More...
|
| |
| Time | operator* (float left, Time right) |
| | Overload of binary * operator to scale a time value. More...
|
| |
| Time | operator* (Int64 left, Time right) |
| | Overload of binary * operator to scale a time value. More...
|
| |
| Time & | operator*= (Time &left, float right) |
| | Overload of binary *= operator to scale/assign a time value. More...
|
| |
| Time & | operator*= (Time &left, Int64 right) |
| | Overload of binary *= operator to scale/assign a time value. More...
|
| |
| Time | operator/ (Time left, float right) |
| | Overload of binary / operator to scale a time value. More...
|
| |
| Time | operator/ (Time left, Int64 right) |
| | Overload of binary / operator to scale a time value. More...
|
| |
| Time & | operator/= (Time &left, float right) |
| | Overload of binary /= operator to scale/assign a time value. More...
|
| |
| Time & | operator/= (Time &left, Int64 right) |
| | Overload of binary /= operator to scale/assign a time value. More...
|
| |
Represents a time value.
sf::Time encapsulates a time value in a flexible way.
It allows to define a time value either as a number of seconds, milliseconds or microseconds. It also works the other way round: you can read a time value as either a number of seconds, milliseconds or microseconds.
By using such a flexible interface, the API doesn't impose any fixed type or resolution for time values, and let the user choose its own favorite representation.
Time values support the usual mathematical operations: you can add or subtract two times, multiply or divide a time by a number, compare two times, etc.
Since they represent a time span and not an absolute time value, times can also be negative.
Usage example:
*
*
*
sf::Time t3 = sf::microseconds(-800000);
*
* {
* position += speed * elapsed.asSeconds();
* }
*
* update(sf::milliseconds(100));
*
- See Also
- sf::Clock
Definition at line 40 of file Time.hpp.