![]() | |
![]() | ![]() |
Entire Class Index | Main Class Index | Cross Index | Global Index |
Rect Class
Contained in: global
Derived from:
none
Derived by:
none
Group: Core (Math)
#include <ClanLib/core.h>
public function member index: |
||
Construction: |
||
CL_Rect | (int nx1 = 0, int ny1 = 0, int nx2 = 0, int ny2 = 0); | |
CL_Rect | (const CL_Rect& rect); | |
Operations: |
||
static CL_Rect | center | (int center_x, int center_y, int width, int height); |
static CL_Rect | left | (int x, int y, int width, int height, bool center_vert = true); |
static CL_Rect | right | (int x, int y, int width, int height, bool center_vert = true); |
void | move | (int delta_x, int delta_y); |
void | normalize | (); |
Attributes: |
||
bool | inside | (int x, int y) const; |
int | get_width | () const; |
int | get_height | () const; |
void | clear | (); |
Operators: |
||
bool | operator == | (const CL_Rect& rect) const; |
nx1 - right constraint
ny1 - bottom constraint
nx2 - left constraint
ny2 - top constraint
rect - The rectangle to copy
center_x - The x coord of the centre
center_y - the y coord of the centre
width - The width of the rectangle
height - The height of the rectangle
Returns - The centred rectangle
Returns - Height of rectangle
Returns - Width of rectangle
x - the x coord of the point
y - the y coord of the point
Returns - True if the point is in the rectangle or on it's border.
x - the left edge of the rectangle
y - the bottom of the rectangle
width - the width of the rectangle
height - the height of the rectangle
centre_vert - centre the rectangle around the y coord
Returns - Left aligned rectangle
delta_x - Distance to move rectangle on x-axis
delta_y - Distance to move rectangle on y-axis
x - the right edge of the rectangle
y - the bottom of the rectangle
width - the width of the rectangle
height - the height of the rectangle
centre_vert - centre the rectangle around the y coord
Returns - Right aligned rectangle