Dualie
Loading...
Searching...
No Matches
dl::Drawable Class Referenceabstract

The base class for any object that can be drawn to the screen. More...

#include <Drawable.hpp>

Inheritance diagram for dl::Drawable:

Public Member Functions

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
 
virtual void draw (const dl::Vector2f &viewOffset)=0
 Draws the drawable to the screen.
 

Protected Attributes

bool m_bViewDoesAffect = true
 
float m_depth = 0.0f
 

Detailed Description

The base class for any object that can be drawn to the screen.

Member Function Documentation

◆ draw()

virtual void dl::Drawable::draw ( const dl::Vector2f & viewOffset)
pure virtual

Draws the drawable to the screen.

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

Implemented in dl::CircleShape, dl::Line, dl::RectangleShape, dl::Sprite, and dl::Text.

◆ getDepth()

const float & dl::Drawable::getDepth ( ) const
Returns
The depth of the drawable

◆ setDepth()

void dl::Drawable::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.

Parameters
depthThe depth of the object

◆ viewShouldAffect()

void dl::Drawable::viewShouldAffect ( bool effective)

Set whether the current view should affect the position of the drawable. Otherwise, its position on the screen will be absolute.

Parameters
effectiveWhether the view will be effective on this drawable

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