#pragma once #include #include "raylib.h" #include "config.h" #include "buttonActionMap.h" class GUI { public: GUI(); GUI(int button_x, int button_y, int button_width, int button_height, std::string button_title, Font* _font); virtual bool Update(); virtual void Draw(); void Tick(); bool GetChecked(); void Checked(); void UnChecked(); protected: int x, y, width, height; std::string title; bool isChecked = false; Rectangle rect; Font* font; }; class GUISlider : public GUI { private: float padding; Rectangle leftButton; Rectangle rightButton; float *sliderValue; bool changeValueMode = false; void ValueUp(); void ValueDown(); public: enum class arrowCheck { none = 0, left, right, slider }; GUISlider(); GUISlider(int slider_x, int slider_y, int slider_width, int slider_height, std::string slider_title, Font *_font, float *value); virtual bool Update(); virtual void Draw(); bool MouseSliding(); arrowCheck arrow = arrowCheck::none; };