BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
bugui::rectangle Struct Reference

Provides the geometric structure of widgets. More...

#include <rectangle.hpp>

Inheritance diagram for bugui::rectangle:
bugui::base_widget bugui::painter bugui::presser bugui::base_container_widget bugui::base_controller bugui::ctrlr_deleter< T > bugui::ctrlr_deleter< T > bugui::ctrlr_deleter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::controller< T > bugui::controller< T > bugui::controller< T > bugui::controller< T >

Public Member Functions

int get_x () const
int get_y () const
void set_x (int new_x)
void set_y (int new_y)
int get_width () const
int get_height () const
void set_width (int new_width)
void set_height (int new_height)
void set_size (int new_size)
void set (int new_x, int new_y)
void set (int new_x, int new_y, int new_width, int new_height)
const pointget_top_left () const
const pointget_bottom_right () const
void set_top_left (point &&new_top_left)
void set_bottom_right (point &&new_bottom_right)

Protected Member Functions

virtual bool overlap (rectangle &other) const
 Checks whether this rectangle overlaps with another. This funciton is the bassis for handling inputs on the grid. The presser object also inherits from rectangle, and this function is called to check if a press event overlaps with a widget. If so, we can determine that this particular widget is pressed. Custom widgets can override this funciton for a more fine grained handling of presses.

Detailed Description

Provides the geometric structure of widgets.

Member Function Documentation

◆ overlap()

virtual bool bugui::rectangle::overlap ( rectangle & other) const
protectedvirtual

Checks whether this rectangle overlaps with another. This funciton is the bassis for handling inputs on the grid. The presser object also inherits from rectangle, and this function is called to check if a press event overlaps with a widget. If so, we can determine that this particular widget is pressed. Custom widgets can override this funciton for a more fine grained handling of presses.

Returns
true if this rectangle overlaps with the other, false otherwise

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