bool is_within(const R< T > &range, T value)
Returns true if a value is withing a range.
T from_01(const R< T > &range, float value)
Converts a value in 0-1 range to a custom range.
std::string to_string(const Rect &r)
v2 to_01(const Rect &r, const v2 &from)
constexpr Lrtb(float lr, float tb)
constexpr Lrtb(float l, float r, float t, float b)
constexpr Lrtb(float all)
A (inclusive) range between two values.
static Rect from_point(const v2 &point)
static Rect from_left_right_top_bottom(float left_side, float right_side, float top_side, float bottom_side)
Rect get_top(float amount) const
bool contains_exclusive(const Rect &r) const
does this contains the argument?
Rect get_right(float amount) const
static Rect from_left_right_bottom_top(float left_side, float right_side, float bottom_side, float top_side)
static Rect from_size(const v2 &size)
v2 get_center_pos() const
Rect add_left(float amount) const
Rect cut_left(float amount, float h_spacing=0.0f)
Rect get_bottom(float amount) const
R< float > get_range_x() const
static Rect from_scaled(const Rect &self, float scale)
scaled copy around rect center
void inset(const Lrtb &lrtb)
void extend(const Rect &o)
R< float > get_range_y() const
Rect with_inset(const Lrtb &lrtb) const
static Rect from_center_inside_other(const Rect &self, const Rect &other)
centers the self rectangle inside the other rectangle
void translate(const v2 &v)
Rect with_offset(const v2 &p) const
Rect cut(RectCut side, float amount, float spacing=0.0f)
static Rect from_top_left_size(const v2 &top_left, const v2 &size)
v2 get_bottom_left() const
Rect with_translate(const v2 &v) const
v2 get_bottom_right() const
Rect cut_right(float amount, float h_spacing=0.0f)
Rect add_top(float amount) const
Rect add_bottom(float amount) const
static Rect from_bottom_left_size(const v2 &bl, const v2 &size)
Rect with_top_left_at(const v2 &p) const
Rect with_bottom_left_at(const v2 &p) const
Rect cut_top(float amount, float v_spacing=0.0f)
v2 get_relative_center_pos() const
Rect cut_bottom(float amount, float v_spacing=0.0f)
Rect add_right(float amount) const
Rect with_scale(float hor, float vert) const
Rect get_left(float amount) const
bool operator==(const Rect &rhs)=delete