Dualie
Loading...
Searching...
No Matches
Drawable.hpp
1//
2// Created by caleb on 6/16/24.
3//
4
5#ifndef DUALIE_DRAWABLE_HPP
6#define DUALIE_DRAWABLE_HPP
7
8#include <Dualie/System/Vector2.hpp>
9
10namespace dl {
11
15 class Drawable {
16
17 protected:
18 bool m_bViewDoesAffect = true;
19 float m_depth = 0.0f;
20
21 public:
22
28 void viewShouldAffect(bool effective);
29
30
37 void setDepth(float depth);
38
43 const float& getDepth() const;
44
50 virtual void draw(const dl::Vector2f& viewOffset) = 0;
51
52
53 };
54
55
56
57
58
59}
60
61
62#endif //DUALIE_DRAWABLE_HPP
The base class for any object that can be drawn to the screen.
Definition Drawable.hpp:15
virtual void draw(const dl::Vector2f &viewOffset)=0
Draws the drawable to the screen.
void viewShouldAffect(bool effective)
Set whether the current view should affect the position of the drawable. Otherwise,...
Definition Drawable.cpp:6
const float & getDepth() const
Definition Drawable.cpp:16
void setDepth(float depth)
Sets the depth of the drawable for 3d. This simply corresponds to the X offset calculated for the 2 s...
Definition Drawable.cpp:11