Mana
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Attributes | List of all members
Actor Class Referenceabstract

#include <actor.h>

Inheritance diagram for Actor:
ActorSprite Particle Being FloorItem ImageParticle TextParticle LocalPlayer AnimationParticle RotationalParticle

Public Member Functions

 Actor ()
 
virtual ~Actor ()
 
virtual bool draw (Graphics *graphics, int offsetX, int offsetY) const =0
 Draws the Actor to the given graphics context.
 
const VectorgetPosition () const
 Returns the pixel position of this actor.
 
virtual void setPosition (const Vector &pos)
 Sets the pixel position of this actor.
 
int getPixelX () const
 Returns the pixels X coordinate of the actor.
 
int getPixelY () const
 Returns the pixel Y coordinate of the actor.
 
virtual int getDrawOrder () const
 Returns the pixel Y coordinate that the actor should be drawn at.
 
virtual bool drawnWhenBehind () const
 Determines wether the actor should be drawn translucent when behind another object.
 
virtual int getTileX () const
 Returns the x coordinate in tiles of the actor.
 
virtual int getTileY () const
 Returns the y coordinate in tiles of the actor.
 
virtual float getAlpha () const =0
 Returns the current alpha value used to draw the actor.
 
virtual void setAlpha (float alpha)=0
 Sets the alpha value used to draw the actor.
 
virtual void setMap (Map *map)
 
MapgetMap () const
 

Protected Attributes

MapmMap = nullptr
 
Vector mPos
 Position in pixels relative to map.
 

Private Attributes

Actors::iterator mMapActor
 

Detailed Description

Definition at line 34 of file actor.h.

Constructor & Destructor Documentation

◆ Actor()

Actor::Actor ( )
default

◆ ~Actor()

Actor::~Actor ( )
virtual

Definition at line 27 of file actor.cpp.

Member Function Documentation

◆ draw()

virtual bool Actor::draw ( Graphics graphics,
int  offsetX,
int  offsetY 
) const
pure virtual

Draws the Actor to the given graphics context.

Note: this function could be simplified if the graphics context would support setting a translation offset. It already does this partly with the clipping rectangle support.

Implemented in ActorSprite, FloorItem, ImageParticle, Particle, and TextParticle.

◆ drawnWhenBehind()

virtual bool Actor::drawnWhenBehind ( ) const
inlinevirtual

Determines wether the actor should be drawn translucent when behind another object.

Reimplemented in Being, Particle, and TextParticle.

Definition at line 84 of file actor.h.

◆ getAlpha()

virtual float Actor::getAlpha ( ) const
pure virtual

Returns the current alpha value used to draw the actor.

Implemented in ActorSprite, and Particle.

◆ getDrawOrder()

virtual int Actor::getDrawOrder ( ) const
inlinevirtual

Returns the pixel Y coordinate that the actor should be drawn at.

Reimplemented in ActorSprite, and TextParticle.

Definition at line 77 of file actor.h.

◆ getMap()

Map * Actor::getMap ( ) const
inline

Definition at line 109 of file actor.h.

◆ getPixelX()

int Actor::getPixelX ( ) const
inline

Returns the pixels X coordinate of the actor.

Definition at line 65 of file actor.h.

◆ getPixelY()

int Actor::getPixelY ( ) const
inline

Returns the pixel Y coordinate of the actor.

Definition at line 71 of file actor.h.

◆ getPosition()

const Vector & Actor::getPosition ( ) const
inline

Returns the pixel position of this actor.

Definition at line 53 of file actor.h.

◆ getTileX()

int Actor::getTileX ( ) const
virtual

Returns the x coordinate in tiles of the actor.

Reimplemented in Being, and FloorItem.

Definition at line 45 of file actor.cpp.

◆ getTileY()

int Actor::getTileY ( ) const
virtual

Returns the y coordinate in tiles of the actor.

Reimplemented in Being, and FloorItem.

Definition at line 50 of file actor.cpp.

◆ setAlpha()

virtual void Actor::setAlpha ( float  alpha)
pure virtual

Sets the alpha value used to draw the actor.

Implemented in ActorSprite, and Particle.

◆ setMap()

void Actor::setMap ( Map map)
virtual

Reimplemented in Being, and ActorSprite.

Definition at line 32 of file actor.cpp.

◆ setPosition()

virtual void Actor::setPosition ( const Vector pos)
inlinevirtual

Sets the pixel position of this actor.

Reimplemented in Being.

Definition at line 59 of file actor.h.

Member Data Documentation

◆ mMap

Map* Actor::mMap = nullptr
protected

Definition at line 113 of file actor.h.

◆ mMapActor

Actors::iterator Actor::mMapActor
private

Definition at line 117 of file actor.h.

◆ mPos

Vector Actor::mPos
protected

Position in pixels relative to map.

Definition at line 114 of file actor.h.


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