game/mario/gui/gui.cpp
zv0n 2402567330
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Added generic button
2022-06-21 14:53:10 +02:00

12 lines
580 B
C++

#include "gui.hpp"
std::shared_ptr<SDLPP::RectangleRender>
createButton(double x, double y, double w, double h,
std::shared_ptr<SDLPP::Renderer> &r, const std::string &text,
const std::string &color, const std::string &outline_color,
const std::string &background_color,
std::function<void(void *)> click_fun, void *input) {
auto button = std::make_shared<Button>(
x, y, w, h, r, text, color, outline_color, background_color, click_fun, input);
return std::static_pointer_cast<SDLPP::RectangleRender>(button);
}