|
virtual void | setup ()=0 |
| This function is called once at the beginning of the program. More...
|
|
virtual void | update ()=0 |
| This function is called repeatedly until the program is terminated. More...
|
|
virtual void | cleanup () |
| This function is called once at the end of the program. More...
|
|
virtual bool | onWindowClose () |
| This function can be used to intercept the window close event. More...
|
|
virtual void | onTextInput (const sf::Event::TextEvent &event) |
| This function is called when keys on the keyboard are pressed. To be used for text input. More...
|
|
virtual void | onKeyPressed (const sf::Event::KeyEvent &event) |
| This function is called when keys on the keyboard are pressed. To be used for key bindings, not text. More...
|
|
virtual void | onKeyReleased (const sf::Event::KeyEvent &event) |
| This function is called when keys on the keyboard are released. More...
|
|
virtual void | onMousePressed (const sf::Event::MouseButtonEvent &event) |
| This function is called when a mouse button is pressed. More...
|
|
virtual void | onMouseReleased (const sf::Event::MouseButtonEvent &event) |
| This function is called when a mouse button is released. More...
|
|
virtual void | onMouseMoved (const sf::Event::MouseMoveEvent &event) |
| This function is called when the mouse is moved. More...
|
|
virtual void | onMouseWheel (const sf::Event::MouseWheelScrollEvent &event) |
| This function is called when the mouse wheel is scrolled. More...
|
|
virtual void | onMouseEnter () |
| This function is called when the mouse enters the window. More...
|
|
virtual void | onMouseLeave () |
| This function is called when the mouse leaves the window. More...
|
|
virtual void | onWindowResize () |
| This function is called when the window is resized. More...
|
|
virtual void | onWindowFocus () |
| This function is called when the window is focused. More...
|
|
virtual void | onWindowUnfocus () |
| This function is called when the window loses focus. More...
|
|
void | background (const sf::Color &color) |
| Set the background color of the window for the current frame. More...
|
|
void | background (uint8_t shade) |
| Set the background color of the window for the current frame. More...
|
|
void | background (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
| Set the background color of the window. More...
|
|
void | fill (const sf::Color &color) |
| Set the infill color for primitives. More...
|
|
void | fill (uint8_t shade) |
| Set the infill color for primitives. More...
|
|
void | fill (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
| Set the infill color for primitives. More...
|
|
void | noFill () |
| Disable the infill color for primitives.
|
|
void | stroke (const sf::Color &color) |
| Set the outline color for primitives.
|
|
void | stroke (uint8_t shade) |
| Set the outline color for primitives. More...
|
|
void | stroke (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
| Set the outline color for primitives. More...
|
|
void | noStroke () |
| Disable the outline color for primitives.
|
|
void | strokeWeight (float weight) |
| Set the thickness of the outline for primitives. More...
|
|
void | push () |
| Push the current draw style onto the stack. More...
|
|
void | pop () |
| Pop the current draw style from the stack. More...
|
|
void | line (float x1, float y1, float x2, float y2) |
| Draw a line from (x1, y1) to (x2, y2) More...
|
|
void | lineCap (LineCap cap) |
| Set the line cap style. More...
|
|
void | rect (float x, float y, float w, float h) |
| Draw a rectangle at (x, y) with the given width and height. More...
|
|
void | rectMode (RectMode mode) |
| Where the origin of the rectangle is. More...
|
|
void | circle (float x, float y, float radius) |
| Draw a circle at (x, y) with the given radius. More...
|
|
void | ellipse (float x, float y, float w, float h) |
| Draw an ellipse at (x, y) with the given width and height. More...
|
|
void | triangle (float x1, float y1, float x2, float y2, float x3, float y3) |
| Draw a triangle with the given points. More...
|
|
void | vector (float vectorX, float vectorY, float originX, float originY) |
| Draw a vector arrow from the origin to origin + vector. More...
|
|
void | textFont (const sf::Font &font) |
| Set the current font to be used for rendering from now on. More...
|
|
sf::Font | loadFont (const std::string &filename) |
| Load a font from a file with a specific size. More...
|
|
void | textAlign (TextAlign alignment) |
| Set the current alignment for drawing text. More...
|
|
float | textWidth (const std::string &text) |
| Calculate the width of a text string in pixels. More...
|
|
void | textSize (uint32_t size) |
| Set the font size of the currently active font. More...
|
|
void | text (const std::string &text, float x, float y) |
| Draw text at (x, y) More...
|
|
void | size (int w, int h) |
| Set the size of the window. More...
|
|
void | setTitle (const std::string &text) |
| Set the title of the window. More...
|
|
void | setFrameRate (float framerate) |
| Set the maximum framerate limit in frames per second. More...
|
|
void | fullscreen () |
| Switch to fullscreen mode. More...
|
|
void | exitFullscreen () |
| Exit fullscreen mode. More...
|
|
void | close () |
| Stop the application. More...
|
|
void | focus () |
| Request the window to be focused. More...
|
|
template<typename... Args> |
void | print (Args &&... args) |
| Print a formatted string without newline to the console (FMT/Python formatting supported) More...
|
|
template<typename... Args> |
void | println (Args &&... args) |
| Print a formatted string with newline to the console (FMT/Python formatting supported) More...
|
|
std::string | encodeBase64 (const std::vector< uint8_t > &input) |
| Encode an arbitrary resource in base-64 encoding. More...
|
|
std::vector< uint8_t > | decodeBase64 (const std::string &input) |
| Decode a base-64 encoded string into its original form. More...
|
|
float | dist (float x1, float y1, float x2, float y2) |
| Get the distance between two points. More...
|
|
float | radians (float degrees) |
| Convert degrees to radians. More...
|
|
float | degrees (float radians) |
| Convert radians to degrees. More...
|
|
template<typename T > |
T | max (T a, T b) |
| Get the greater of two values. More...
|
|
template<typename T > |
T | min (T a, T b) |
| Get the lesser of two values. More...
|
|
template<typename T > |
T | clamp (T value, T min, T max) |
| Clamp the value between the given min and max. More...
|
|
void | randomSeed (uint32_t seed) |
| Set the seed for the random number generator. More...
|
|
int | randomInt (int min, int max) |
| Generate a random integer value between min and max. More...
|
|
int | randomInt (int max) |
| Generate a random integer value between 0 and the maximum. More...
|
|
float | random (float min, float max) |
| Generate a random floating point value between min and max. More...
|
|
float | random (float max) |
| Generate a random floating point value between 0 and the maximum. More...
|
|
uint64_t | micros () |
| Get the number of microseconds since the program started. More...
|
|
uint64_t | millis () |
| Get the number of milliseconds since the program started. More...
|
|
int | second () |
| Get the current second from the system clock [0-59]. More...
|
|
int | minute () |
| Get the current minute from the system clock [0-59]. More...
|
|
int | hour () |
| Get the current hour from the system clock [0-23]. More...
|
|
int | day () |
| Get the current day of the month [1-31]. More...
|
|
int | month () |
| Get the current month of the year [1-12]. More...
|
|
int | year () |
| Get the current year. More...
|
|
void | run () |
| Run the application. More...
|
|
The main application class.
This class is supposed to be inherited by the user.