Euphoria
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eu::Rect Struct Reference

Public Member Functions

 Rect ()
 
bool operator== (const Rect &rhs)=delete
 
void extend (const Rect &o)
 
void translate (const v2 &v)
 
void inset (const Lrtb &lrtb)
 
void set_empty ()
 
bool contains_exclusive (const Rect &r) const
 does this contains the argument?
 
Rect with_inset (const Lrtb &lrtb) const
 
Rect with_translate (const v2 &v) const
 
Rect with_top_left_at (const v2 &p) const
 
Rect with_bottom_left_at (const v2 &p) const
 
Rect with_offset (const v2 &p) const
 
Rect with_scale (float hor, float vert) const
 
v2 get_bottom_left () const
 
v2 get_center_pos () const
 
v2 get_relative_center_pos () const
 
bool is_empty () const
 
bool is_valid () const
 
v2 get_size () const
 
R< floatget_range_y () const
 
R< floatget_range_x () const
 
v2 get_top_left () const
 
v2 get_top_right () const
 
v2 get_bottom_right () const
 
Rect cut_left (float amount, float h_spacing=0.0f)
 
Rect cut_right (float amount, float h_spacing=0.0f)
 
Rect cut_bottom (float amount, float v_spacing=0.0f)
 
Rect cut_top (float amount, float v_spacing=0.0f)
 
Rect cut (RectCut side, float amount, float spacing=0.0f)
 
Rect get_left (float amount) const
 
Rect get_right (float amount) const
 
Rect get_bottom (float amount) const
 
Rect get_top (float amount) const
 
Rect add_left (float amount) const
 
Rect add_right (float amount) const
 
Rect add_bottom (float amount) const
 
Rect add_top (float amount) const
 

Static Public Member Functions

static Rect from_left_right_bottom_top (float left_side, float right_side, float bottom_side, float top_side)
 
static Rect from_left_right_top_bottom (float left_side, float right_side, float top_side, float bottom_side)
 
static Rect from_bottom_left_size (const v2 &bl, const v2 &size)
 
static Rect from_top_left_size (const v2 &top_left, const v2 &size)
 
static Rect from_size (const v2 &size)
 
static Rect from_point (const v2 &point)
 
static Rect from_center_inside_other (const Rect &self, const Rect &other)
 centers the self rectangle inside the other rectangle
 
static Rect from_scaled (const Rect &self, float scale)
 scaled copy around rect center
 

Public Attributes

float left
 
float right
 
float top
 
float bottom
 

Detailed Description

Definition at line 26 of file rect.h.

Constructor & Destructor Documentation

◆ Rect()

eu::Rect::Rect ( )

Member Function Documentation

◆ add_bottom()

Rect eu::Rect::add_bottom ( float  amount) const

◆ add_left()

Rect eu::Rect::add_left ( float  amount) const

◆ add_right()

Rect eu::Rect::add_right ( float  amount) const

◆ add_top()

Rect eu::Rect::add_top ( float  amount) const

◆ contains_exclusive()

bool eu::Rect::contains_exclusive ( const Rect r) const

does this contains the argument?

◆ cut()

Rect eu::Rect::cut ( RectCut  side,
float  amount,
float  spacing = 0.0f 
)

◆ cut_bottom()

Rect eu::Rect::cut_bottom ( float  amount,
float  v_spacing = 0.0f 
)

◆ cut_left()

Rect eu::Rect::cut_left ( float  amount,
float  h_spacing = 0.0f 
)

◆ cut_right()

Rect eu::Rect::cut_right ( float  amount,
float  h_spacing = 0.0f 
)

◆ cut_top()

Rect eu::Rect::cut_top ( float  amount,
float  v_spacing = 0.0f 
)

◆ extend()

void eu::Rect::extend ( const Rect o)

◆ from_bottom_left_size()

static Rect eu::Rect::from_bottom_left_size ( const v2 bl,
const v2 size 
)
static

◆ from_center_inside_other()

static Rect eu::Rect::from_center_inside_other ( const Rect self,
const Rect other 
)
static

centers the self rectangle inside the other rectangle

◆ from_left_right_bottom_top()

static Rect eu::Rect::from_left_right_bottom_top ( float  left_side,
float  right_side,
float  bottom_side,
float  top_side 
)
static

◆ from_left_right_top_bottom()

static Rect eu::Rect::from_left_right_top_bottom ( float  left_side,
float  right_side,
float  top_side,
float  bottom_side 
)
static

◆ from_point()

static Rect eu::Rect::from_point ( const v2 point)
static

◆ from_scaled()

static Rect eu::Rect::from_scaled ( const Rect self,
float  scale 
)
static

scaled copy around rect center

◆ from_size()

static Rect eu::Rect::from_size ( const v2 size)
static

◆ from_top_left_size()

static Rect eu::Rect::from_top_left_size ( const v2 top_left,
const v2 size 
)
static

◆ get_bottom()

Rect eu::Rect::get_bottom ( float  amount) const

◆ get_bottom_left()

v2 eu::Rect::get_bottom_left ( ) const

◆ get_bottom_right()

v2 eu::Rect::get_bottom_right ( ) const

◆ get_center_pos()

v2 eu::Rect::get_center_pos ( ) const

◆ get_left()

Rect eu::Rect::get_left ( float  amount) const

◆ get_range_x()

R< float > eu::Rect::get_range_x ( ) const

◆ get_range_y()

R< float > eu::Rect::get_range_y ( ) const

◆ get_relative_center_pos()

v2 eu::Rect::get_relative_center_pos ( ) const

◆ get_right()

Rect eu::Rect::get_right ( float  amount) const

◆ get_size()

v2 eu::Rect::get_size ( ) const

◆ get_top()

Rect eu::Rect::get_top ( float  amount) const

◆ get_top_left()

v2 eu::Rect::get_top_left ( ) const

◆ get_top_right()

v2 eu::Rect::get_top_right ( ) const

◆ inset()

void eu::Rect::inset ( const Lrtb lrtb)

◆ is_empty()

bool eu::Rect::is_empty ( ) const

◆ is_valid()

bool eu::Rect::is_valid ( ) const

◆ operator==()

bool eu::Rect::operator== ( const Rect rhs)
delete

◆ set_empty()

void eu::Rect::set_empty ( )

◆ translate()

void eu::Rect::translate ( const v2 v)

◆ with_bottom_left_at()

Rect eu::Rect::with_bottom_left_at ( const v2 p) const

◆ with_inset()

Rect eu::Rect::with_inset ( const Lrtb lrtb) const

◆ with_offset()

Rect eu::Rect::with_offset ( const v2 p) const

◆ with_scale()

Rect eu::Rect::with_scale ( float  hor,
float  vert 
) const

◆ with_top_left_at()

Rect eu::Rect::with_top_left_at ( const v2 p) const

◆ with_translate()

Rect eu::Rect::with_translate ( const v2 v) const

Member Data Documentation

◆ bottom

float eu::Rect::bottom

Definition at line 31 of file rect.h.

◆ left

float eu::Rect::left

Definition at line 28 of file rect.h.

◆ right

float eu::Rect::right

Definition at line 29 of file rect.h.

◆ top

float eu::Rect::top

Definition at line 30 of file rect.h.


The documentation for this struct was generated from the following file: