You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voiddrawTextCenterRect(Rectangle &rect, std::string &text, int fontSize, Color color); // Draws text in the center of a Rectangle voiddrawTextCenterRect(Rectangle& rect, std::string& text, int fontsize, float spacing, Color tint, Font font = GetFontDefault()); // Draws text in the center of Rectangle custom text args (Font is optional)voiddrawRectWOutline(Rectangle& rect, float lineThick, Color color, Color outlineColor); // Draws a Rectangle with an outlinevoiddrawRectWOutlineWText(Rectangle& rect, float lineThick, Color rectColor, Color outlineColor, std::string& text, int fontSize, Color textColor); // Draws a Rectangle with an outline and textvoiddrawRectWOutlineWText(Rectangle& rect, float lineThick, Color rectColor, Color outlineColor, std::string& text, int fontSize, Color textColor, float textSpacing, Font font = GetFontDefault()); // Draws a Rectangle with an outline and text using custom text args (Font is optional)voiddrawButton(RaylibAdditions::ButtonClass* button); // Draws a button using the ButtonClassvoiddrawButtons(std::unordered_map<std::string, ButtonClass>* buttons); // Draws all the buttons in a std::unordererd_mapvoidupdateButtonstates(std::unordered_map<std::string, ButtonClass>* buttons); // Updates the state of all buttons in a std::unordererd_map
Camera2D createCamera(); // Creates a normal Camera2D
Camera2D createCamera(int gameHeight); // Creates camera zooming into game area using getScreenHeight()voiddrawFPSCounter(int position, int fontSize); // Draws an FPS counter at the position supplied 1 = top left, 2 = top middle, 3 = top right, 4 = middle left and so on
Classes
// Window class, construct using title, width, heigth. All args can be changed and then run updateWindow to resize and rename windowclassWindowClass {
public:
std::string title; // Window titleint width; // Window widthint height; // Window heightWindowClass(std::string windowTitle, int windowWidth, int windowHeight) // Constructor~WindowClass() // De-Constructor (runs CloseWindow())voidupdateWindow() // Updates window (run after changing varibles)
};
// Button class, consturct using all args (some are optional)classButtonClass {
public:
Rectangle rect;
std::string text;
int textSize;
Color color;
Color outlineColor;
Color textColor;
int outlineThickness;
float scale;
int state; // state, 1 = hover, 2 = pressed
Sound pressedSound;
Sound releasedSound;
ButtonClass(Rectangle buttonRect, std::string buttonText, int buttonTextSize, Color buttonColor, Color buttonOutlineColor, Color buttonTextColor, int buttonOutlineThickness, float buttonScale, Sound buttonPressedSound = Sound(), Sound buttonReleasedSound = Sound(), int buttonState = 0) // Sounds are optional
};
classFrameClass {
public:
std::vector<Texture2D> textures;
std::vector<Vector2> texturePos;
std::vector<float> textureScales;
};
classLoadedRoomClass {
public:
std::vector<FrameClass> frames;
std::vector<RaylibAdditions::LoadedButtonClass> Buttons;
Sound music;
bool isValid = true;
};
classRoomClass {
public:int ID = 0;
Camera2D camera = RaylibAdditions::createCamera();
// Loads a .gui room made with RaylibGuiCreator https://github.com/SparklesReal/RaylibGuiCreator also this needs to be rewritten
LoadedRoomClass loadRoom(std::string path, std::string fileName);
// Draws a single frameclassvoiddrawFrameClass(FrameClass* frame);
};
RaylibAdditions functions documentation
boolstringIsInt(std::string string); // Goes trough string, returns false if it is not of data type integer