class EE::UI::UIIcon

Overview

#include <uiicon.hpp>

class UIIcon {
public:
    // construction

    virtual ~UIIcon();

    // methods

    static UIIconPtr New(const std::string& name);
    const std::string& getName() const;
    virtual const DrawablePtr& getSource(const int& size) const;
    DrawablePtr createDrawable(const int& size) const;
    virtual void setSource(const int& size, DrawablePtr drawable);
};

Detailed Documentation

Methods

virtual const DrawablePtr& getSource(const int& size) const

Returns the icon source closest to the requested size.

The returned drawable is shared icon data and must not be mutated by consumers. Use createDrawable() when a consumer needs its own mutable drawable instance.

DrawablePtr createDrawable(const int& size) const

Creates a private drawable instance for a consumer. This must not be called from a rendering loop; retain the returned instance instead.