Something went wrong. Try again.
art software for the rest of us
drawing paint image sdl art
Something went wrong. Try again.
C++
1234567891011121314151617181920212223242526272829303132333435363738#include "Rectangle.h"#include "../UserInterface/Primitives.h"
Rectangle::Rectangle(double x, double y, double width, double height) : x(x), y(y), width(width), height(height) {}
void Rectangle::SetColor(double r, double g, double b, double a) { this->r = r; this->g = g; this->b = b; this->a = a;}
void Rectangle::SetBorderColor(double r, double g, double b, double a) { this->br = r; this->bg = g; this->bb = b; this->ba = a;}
void Rectangle::SetBorderWidth(double width) { this->bw = width;}
void Rectangle::SetRoundness(double roundness) { this->roundness = roundness;}
void Rectangle::Render() { UI::Primitives::SubmitRectangle( UI::Rect(static_cast<float>(x), static_cast<float>(y), static_cast<float>(width), static_cast<float>(height)), UI::Color(static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a)), UI::Color(static_cast<float>(br), static_cast<float>(bg), static_cast<float>(bb), static_cast<float>(ba)), static_cast<float>(bw), static_cast<float>(roundness) );}