Bomberman
Public Member Functions | Protected Attributes | List of all members
RAY::Drawables::Drawables2D::Rectangle Class Reference

Rectangle in a two-dimensional space. More...

#include <Rectangle.hpp>

Inheritance diagram for RAY::Drawables::Drawables2D::Rectangle:
Collaboration diagram for RAY::Drawables::Drawables2D::Rectangle:

Public Member Functions

 Rectangle (const Vector2 &position, const Vector2 &dimensions, const Color &color=WHITE, float scale=1, float rotation=0)
 Rectangle constructor. More...
 
 Rectangle (int x, int y, int width, int height, const Color &color=WHITE)
 Rectangle constructor. More...
 
 Rectangle (const Rectangle &)=default
 A default copy constructor. More...
 
Rectangleoperator= (const Rectangle &)=default
 A rectangle is assignable. More...
 
 ~Rectangle () override=default
 A default destructor. More...
 
const Vector2getDimensions (void)
 
float getWidth (void) const
 
float getHeight (void) const
 
RectanglesetDimensions (const Vector2 &dimensions)
 set dimensions More...
 
RectangleincrementWidth (float width)
 increment width of the rectangle More...
 
RectangleincrementHeight (float height)
 increment height of the rectangle More...
 
RectanglesetHeight (float height)
 set rectangle's height More...
 
RectanglesetWidth (float width)
 set rectangle's width More...
 
RectanglesetDimensions (float x, float y)
 set dimensions More...
 
virtual void drawOn (RAY::Window &) override
 Draw point on window. More...
 
virtual void drawOn (RAY::Image &image) override
 Draw point on image. More...
 
- Public Member Functions inherited from RAY::Drawables::ADrawable2D
 ADrawable2D (const Vector2 &position, const RAY::Color &color, float scale=1, float rotation=0)
 ADrawable constructor. More...
 
 ADrawable2D (int x, int y, const RAY::Color &color, float scale=1, float rotation=0)
 ADrawable constructor. More...
 
 ADrawable2D (const ADrawable2D &)=default
 A default copy constructor. More...
 
 ~ADrawable2D () override=default
 A default destructor. More...
 
const RAY::Vector2getPosition (void) const
 
const RAY::ColorgetColor (void) const
 
ADrawable2DsetPosition (const Vector2 &position)
 set Top-left position More...
 
ADrawable2DsetPosition (int x, int y)
 set Top-left position More...
 
ADrawable2DsetColor (const Color &color)
 set color More...
 
float getScale () const
 scale getter More...
 
void setScale (float scale)
 scale setters More...
 
- Public Member Functions inherited from RAY::Drawables::IDrawable
virtual ~IDrawable ()=default
 

Protected Attributes

Vector2 _dimensions
 Diemnsions of the rectangle. More...
 
INTERNAL __pad0__: operator ::Rectangle() const
 
- Protected Attributes inherited from RAY::Drawables::ADrawable2D
float _rotation = 0
 rotation More...
 
float _scale = 1
 scale More...
 
Vector2 _position
 Top-left position. More...
 
Color _color
 Color of the ADrawable. More...
 

Detailed Description

Rectangle in a two-dimensional space.

Constructor & Destructor Documentation

◆ Rectangle() [1/3]

RAY::Drawables::Drawables2D::Rectangle::Rectangle ( const Vector2 position,
const Vector2 dimensions,
const Color color = WHITE,
float  scale = 1,
float  rotation = 0 
)

Rectangle constructor.

Parameters
positionposition of top-left point
dimensionsdimensions of the rectangle
ColorColor of the rectangle

◆ Rectangle() [2/3]

RAY::Drawables::Drawables2D::Rectangle::Rectangle ( int  x,
int  y,
int  width,
int  height,
const Color color = WHITE 
)

Rectangle constructor.

Parameters
xx-position of top-left point
yy-position of top-left point
widthwidth of the rectangle
lengthlength of the rectangle
ColorColor of the rectangle

◆ Rectangle() [3/3]

RAY::Drawables::Drawables2D::Rectangle::Rectangle ( const Rectangle )
default

A default copy constructor.

◆ ~Rectangle()

RAY::Drawables::Drawables2D::Rectangle::~Rectangle ( )
overridedefault

A default destructor.

Member Function Documentation

◆ drawOn() [1/2]

void RAY::Drawables::Drawables2D::Rectangle::drawOn ( RAY::Image image)
overridevirtual

Draw point on image.

Implements RAY::Drawables::ADrawable2D.

Reimplemented in RAY::Image.

◆ drawOn() [2/2]

void RAY::Drawables::Drawables2D::Rectangle::drawOn ( RAY::Window )
overridevirtual

Draw point on window.

Implements RAY::Drawables::ADrawable2D.

Reimplemented in RAY::Image, and RAY::Texture.

◆ getDimensions()

const RAY::Vector2 & RAY::Drawables::Drawables2D::Rectangle::getDimensions ( void  )
Returns
the dimensions of the rectangle

◆ getHeight()

float RAY::Drawables::Drawables2D::Rectangle::getHeight ( void  ) const
Returns
the height of the rectangle

◆ getWidth()

float RAY::Drawables::Drawables2D::Rectangle::getWidth ( void  ) const
Returns
the width of the rectangle

◆ incrementHeight()

Rectangle & RAY::Drawables::Drawables2D::Rectangle::incrementHeight ( float  height)

increment height of the rectangle

Parameters
heightincrementer

◆ incrementWidth()

Rectangle & RAY::Drawables::Drawables2D::Rectangle::incrementWidth ( float  width)

increment width of the rectangle

Parameters
widthincrementer

◆ operator=()

Rectangle& RAY::Drawables::Drawables2D::Rectangle::operator= ( const Rectangle )
default

A rectangle is assignable.

◆ setDimensions() [1/2]

Rectangle & RAY::Drawables::Drawables2D::Rectangle::setDimensions ( const Vector2 dimensions)

set dimensions

◆ setDimensions() [2/2]

Rectangle & RAY::Drawables::Drawables2D::Rectangle::setDimensions ( float  x,
float  y 
)

set dimensions

◆ setHeight()

Rectangle & RAY::Drawables::Drawables2D::Rectangle::setHeight ( float  height)

set rectangle's height

Parameters
heightheight of the rectangle

◆ setWidth()

Rectangle & RAY::Drawables::Drawables2D::Rectangle::setWidth ( float  width)

set rectangle's width

Parameters
widthwidth of the rectangle

Member Data Documentation

◆ __pad0__

INTERNAL RAY::Drawables::Drawables2D::Rectangle::__pad0__
protected

◆ _dimensions

Vector2 RAY::Drawables::Drawables2D::Rectangle::_dimensions
protected

Diemnsions of the rectangle.


The documentation for this class was generated from the following files: