class EE::Graphics::DrawableResource

Overview

#include <drawableresource.hpp>

class DrawableResource: public EE::Graphics::Drawable {
public:
    // typedefs

    typedef std::function<void(Uint32, Event, DrawableResource*)> OnResourceChangeCallback;

    // enums

    enum Event;

    // construction

    virtual ~DrawableResource();

    // methods

    const String::HashType& getId() const;
    const std::string getName() const;
    void setName(const std::string& name);
    virtual bool isDrawableResource() const;
    Uint32 pushResourceChangeCallback(const OnResourceChangeCallback& cb);
    bool popResourceChangeCallback(const Uint32& callbackId);
};

Inherited Members

public:
    // enums

    enum Type;

    // methods

    virtual Sizef getSize() = 0;
    virtual Sizef getPixelsSize() = 0;
    virtual void draw() = 0;
    virtual void draw(const Vector2f& position) = 0;
    virtual void draw(const Vector2f& position, const Sizef& size) = 0;
    virtual bool isStateful() = 0;
    void setAlpha(Uint8 alpha);
    const Uint8& getAlpha();
    void setColor(const Color& color);
    const Color& getColor() const;
    void setColorFilter(const Color& color);
    RGB getColorFilter();
    void clearColor();
    void clearColorFilter();
    void resetAlpha();
    Type getDrawableType() const;
    const Vector2f& getPosition() const;
    void setPosition(const Vector2f& position);
    virtual bool isDrawableResource() const;

Detailed Documentation

Methods

const String::HashType& getId() const

Returns:

The DrawableResource Id. The Id is the String::hash of the name.

const std::string getName() const

Returns:

The DrawableResource Name.

void setName(const std::string& name)

Sets the DrawableResource Name, it will also change the Id.

virtual bool isDrawableResource() const

Always true

Uint32 pushResourceChangeCallback(const OnResourceChangeCallback& cb)

Push a new on resource change callback.

Returns:

The Callback Id

bool popResourceChangeCallback(const Uint32& callbackId)

Pop the on resource change callback id indicated.