Class Prop¶
-
class Prop : public ISaveable¶
A Prop is an object in the world that has an image and optionally has an Interactable.
Public Functions
-
Prop()¶
Empty constructor
-
Prop(const std::string &filePath)¶
Construct from a file.
-
Prop(Rectangle atlasRect, Vector2 worldPos)¶
Construct from an atlas rect and an absolute world position.
-
void setTextureFromPath(const std::string &imagePath)¶
Set the Texture, using an image path.
-
void setCollisionRect(Rectangle collisionRect)¶
Set the collision rectangle.
-
void setAtlasRect(Rectangle atlasRect)¶
Set the Atlas rectangle of this Prop. (which part of the image is used for drawing)
-
Rectangle getCollisionRect() const¶
Get the collision rectangle of this Prop, relative to the Prop itself.
-
Rectangle getWorldCollisionRect() const¶
Get the collision rectangle with position relative to the World. (absolute)
-
Vector2 getCollisionCenter() const¶
Get the position of the center of the collision rectangle.
-
void setHasInteractable(bool value)¶
Set the ‘hasInteractable’ flag.
-
Interactable *getInteractable() const¶
Get a pointer to the Interactable of this Prop.
-
void setInteractableType(const std::string &type)¶
Set the type of this Prop’s Interactable.
-
std::string getInteractableType() const¶
Get the type of this Prop’s Interactable.
-
void draw() const¶
Draw routine.
-
Prop()¶