Arduboy2 Library  6.0.0
Rect Struct Reference

A rectangle object for collision functions. More...

#include <Arduboy2.h>

Public Member Functions

 Rect ()=default
 The default constructor.
 
constexpr Rect (int16_t x, int16_t y, uint8_t width, uint8_t height)
 The fully initializing constructor. More...
 

Public Attributes

int16_t x
 
int16_t y
 
uint8_t width
 
uint8_t height
 

Detailed Description

A rectangle object for collision functions.

The X and Y coordinates specify the top left corner of a rectangle with the given width and height.

See also
Arduboy2Base::collide(Point, Rect) Arduboy2Base::collide(Rect, Rect) Point

Definition at line 108 of file Arduboy2.h.

Constructor & Destructor Documentation

◆ Rect()

constexpr Rect::Rect ( int16_t  x,
int16_t  y,
uint8_t  width,
uint8_t  height 
)
inlineconstexpr

The fully initializing constructor.

Parameters
xThe X coordinate of the top left corner. Copied to variable x.
yThe Y coordinate of the top left corner. Copied to variable y.
widthThe width of the rectangle. Copied to variable width.
heightThe height of the rectangle. Copied to variable height.

Definition at line 128 of file Arduboy2.h.

Member Data Documentation

◆ height

uint8_t Rect::height

The height of the rectangle

Definition at line 113 of file Arduboy2.h.

◆ width

uint8_t Rect::width

The width of the rectangle

Definition at line 112 of file Arduboy2.h.

◆ x

int16_t Rect::x

The X coordinate of the top left corner

Definition at line 110 of file Arduboy2.h.

◆ y

int16_t Rect::y

The Y coordinate of the top left corner

Definition at line 111 of file Arduboy2.h.


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