class EE::Graphics::GlyphDrawable

Overview

#include <glyphdrawable.hpp>

class GlyphDrawable: public EE::Graphics::DrawableResource {
public:
    // enums

    enum DrawMode;

    // construction

    GlyphDrawable(Texture* texture, const Rect& srcRect, const Sizef& destSize = {}, const std::string& resourceName = "");

    // methods

    static GlyphDrawable* New(Texture* texture, const Rect& srcRect, const Sizef& destSize = {}, const std::string& resourceName = "");
    virtual void draw();
    virtual void draw(const Vector2f& position);
    virtual void draw(const Vector2f& position, const Sizef& size);
    virtual void drawIntoVertexBuffer(VertexBuffer* vbo, const Vector2u& gridPos, const Vector2f& pos, const Uint32& textureLevel = 0);
    virtual bool isStateful();
    Texture* getTexture();
    const Rectf& getSrcRect() const;
    const Sizef& getDestSize() const;
    virtual Sizef getSize();
    virtual Sizef getPixelsSize();
    const Float& getPixelDensity() const;
    void setPixelDensity(const Float& pixelDensity);
    const Vector2f& getGlyphOffset() const;
    void setGlyphOffset(const Vector2f& glyphOffset);
    const DrawMode& getDrawMode() const;
    void setDrawMode(const DrawMode& drawMode);
    bool isItalic() const;
    void setIsItalic(bool isItalic);
    const Float& getAdvance() const;
    void setAdvance(Float advance);
};

Inherited Members

public:
    // typedefs

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

    // enums

    enum Type;
    enum Event;

    // 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;
    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);

Detailed Documentation

Methods

Texture* getTexture()

Returns:

The texture instance used by the GlyphDrawable.

const Rectf& getSrcRect() const

Returns:

The Texture sector that represents the GlyphDrawable

virtual Sizef getSize()

Returns:

This is the same as Destination Size but with the values rounded as integers.