Dualie
Loading...
Searching...
No Matches
dl::RectangleShape Class Reference

A rectangle shape. More...

#include <RectangleShape.hpp>

Inheritance diagram for dl::RectangleShape:
Collaboration diagram for dl::RectangleShape:

Public Member Functions

 RectangleShape (const dl::Vector2f &size)
 
void setSize (const dl::Vector2f &size)
 Sets the size of the rectangle.
 
void draw (const dl::Vector2f &viewOffset) override
 Draws the drawable to the screen.
 
- Public Member Functions inherited from dl::Shape
void setFillColor (const dl::Color &color)
 Sets the fill color of the shape.
 
void setOutlineColor (const dl::Color &color)
 Sets the outline color of the shape.
 
void setOutlineThickness (float thickness)
 Sets the outline thickness of the shape.
 
void setOrigin (const dl::Vector2f &origin)
 Sets the origin of the shape. The default origin is (0,0) and is the top left pixel of the shape bounds. Setting the origin can affect where the shape is drawn. For instance, setting the origin to be half the shape size will cause the shape to be centered on its position.
 
void setOrigin (float x, float y)
 Sets the origin of the shape. The default origin is (0,0) and is the top left pixel of the shape bounds. Setting the origin can affect where the shape is drawn. For instance, setting the origin to be half the shape size will cause the shape to be centered on its position.
 
const dl::Vector2fgetSize ()
 
const dl::Vector2fgetOrigin ()
 
dl::FloatRect getLocalBounds ()
 
dl::FloatRect getGlobalBounds ()
 
const ColorgetFillColor () const
 
const ColorgetOutlineColor () const
 
const float & getOutlineThickness ()
 
- Public Member Functions inherited from dl::Transformable
virtual void setPosition (const dl::Vector2f &position)
 Sets the position of the transformable.
 
void setPosition (float x, float y)
 Sets the position of the transformable.
 
virtual void move (const dl::Vector2f &offset)
 Moves the transformable offset number of pixels.
 
void move (float xOffset, float yOffset)
 Moves the transformable offset number of pixels.
 
const dl::Vector2fgetPosition () const
 
- Public Member Functions inherited from dl::Drawable
void viewShouldAffect (bool effective)
 Set whether the current view should affect the position of the drawable. Otherwise, its position on the screen will be absolute.
 
void setDepth (float depth)
 Sets the depth of the drawable for 3d. This simply corresponds to the X offset calculated for the 2 separate top screens. Larger objects will require a deeper depth for the 3d effect to be noticable. A positive value will cause the drawable to sink into the screen, while a negative value will cause it to pop out.
 
const float & getDepth () const
 

Additional Inherited Members

- Protected Attributes inherited from dl::Shape
dl::Color m_fillColor
 
dl::Color m_outlineColor
 
float m_outlineThickness
 
dl::Vector2f m_origin
 
dl::Vector2f m_size
 
- Protected Attributes inherited from dl::Transformable
dl::Vector2f m_position
 
- Protected Attributes inherited from dl::Drawable
bool m_bViewDoesAffect = true
 
float m_depth = 0.0f
 

Detailed Description

A rectangle shape.

Member Function Documentation

◆ draw()

void dl::RectangleShape::draw ( const dl::Vector2f & viewOffset)
overridevirtual

Draws the drawable to the screen.

Parameters
viewOffsetThe offset of the current view to be used for internal drawable positioning

Implements dl::Drawable.

◆ setSize()

void dl::RectangleShape::setSize ( const dl::Vector2f & size)

Sets the size of the rectangle.

Parameters
sizeThe size in pixels

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