![]() |
Gamedev Framework (gf)
0.4.0
A C++11 framework for 2D games
|
Helper to compute coordinates in HUD. More...
#include <gf/Coordinates.h>
Public Member Functions | |
Coordinates (Vector2u size) | |
Constructor with size. More... | |
Coordinates (RenderTarget &target) | |
Constructor with render target. More... | |
Vector2f | getCenter () const |
Get the center of the window. More... | |
Vector2f | getRelativePoint (Vector2f percent) const |
Compute a relative point. More... | |
Vector2f | getRelativeSize (Vector2f percent) const |
Compute a relative size. More... | |
unsigned | getRelativeCharacterSize (float percent) const |
Compute a relative character size. More... | |
Vector2f | getAbsolutePoint (Vector2f distance, Anchor anchor) const |
Compute an absolute point. More... | |
Helper to compute coordinates in HUD.
gf::Coordinates::Coordinates | ( | Vector2u | size | ) |
Constructor with size.
size | The size of the window |
gf::Coordinates::Coordinates | ( | RenderTarget & | target | ) |
Constructor with render target.
target | The render target |
Compute an absolute point.
distance | The distance from the edge |
anchor | The reference anchor |
Vector2f gf::Coordinates::getCenter | ( | ) | const |
Get the center of the window.
unsigned gf::Coordinates::getRelativeCharacterSize | ( | float | percent | ) | const |
Compute a relative character size.
percent | The percentage of the window |
Compute a relative point.
percent | The percentage from top-right |