class EE::Graphics::GlyphDrawable

Overview

#include <glyphdrawable.hpp>

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

    enum DrawMode;

    // construction

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

    // methods

    static GlyphDrawable* New(TexturePtr 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();
    virtual DrawablePtr clone() const;
    const TexturePtr& getTexture() const;
    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);
    GlyphRenderMode getGlyphRenderMode() const;
    void setGlyphRenderMode(GlyphRenderMode renderMode);
};

Inherited Members

public:
    // typedefs

    typedef DrawableResourceCallbackState::Callback OnResourceChangeCallback;

    // enums

    enum Type;

    // methods

    virtual Sizef getSize() = 0;
    virtual Sizef getPixelsSize() = 0;
    virtual Float getMinIntrinsicWidth();
    virtual Float getMaxIntrinsicWidth();
    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;
    virtual DrawablePtr clone() const;
    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;
    DrawableResourceConnection connectResourceChange(OnResourceChangeCallback cb);

Detailed Documentation

Methods

virtual DrawablePtr clone() const

Creates an independently mutable instance backed by the same immutable resource data. This is an ownership/setup operation; rendering loops must retain and reuse the result.

const TexturePtr& getTexture() const

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.