Raylib Bubbles
C++11 Raylib bubble shooter game.
|
Provides an object to manage the game HUD state. More...
#include <hud.hpp>
Classes | |
struct | Arrow |
The data structure used to handle the player's arrow. More... | |
struct | ArrowPiece |
Represents a texture of the bubble shooter the player controls. More... | |
struct | HeldBubble |
Public Member Functions | |
GameHUD (const PlacedBoard::BoardDims &boardDims) | |
Arrow related methods. | |
void | updateArrowDirection (const float offsetRad) |
Updates the direction of the arrow. More... | |
void | updateHUDPosition (const float offsetX, const float offsetY) |
Updates the position of the HUD. More... | |
const GameHUD::Arrow & | getArrow () const |
Gives readonly access to the arrow data. More... | |
float | getArrowWidth () const |
Calculates the expected width with the current arrow layout. More... | |
float | getArrowHeight () const |
Calculates the expected height with the current arrow layout. More... | |
Bubble related methods. | |
const size_t | getHeld () const |
const std::array< HeldBubble, 5 > & | getHeldBubbles () const |
void | setHeldBubble (const size_t index, const size_t hue) |
void | shiftInHeldBubbles (const size_t hue) |
size_t | heldSize () const |
Provides an object to manage the game HUD state.
This class allows managing the HUD of the game, and can be passed to GameWindow to render the HUD elements. It is a stateful object that holds the current state of the HUD, and can be updated by calling its methods, but it will not directly render anything to the screen.
|
inline |
Gives readonly access to the arrow data.
|
inline |
Calculates the expected height with the current arrow layout.
|
inline |
Calculates the expected width with the current arrow layout.
void GameHUD::updateArrowDirection | ( | const float | offsetRad | ) |
Updates the direction of the arrow.
offsetRad | The offset in radians to change the direction of the arrow by. |
void GameHUD::updateHUDPosition | ( | const float | offsetX, |
const float | offsetY | ||
) |
Updates the position of the HUD.
offsetX | The x offset to change the position of the HUD by. |
offsetY | The y offset to change the position of the HUD by. |