Overlay Image Element

// Overlay image element.
class RVAPI ImageElem
{
public:
    // Get frame dimensions.
    S2i GetFrameDims() const;

    // Resolve relolution independent element rectangle using parent rectangle [pRect].
    B2i GetRect(const B2i &pRect) const;

    // Get meta position.
    const MetaPos &GetMetaPos() const;

    // Draw image. [pRect] is parent rectangle for resolving meta position. [stateColor] is multiplied 
    // with text color and can be a literal color or the state color returned from UI events object.
    void Draw(const B2i &pRect, const Color &stateColor = Color(1)) const;

    // Show/hide element.
    void Show(bool show = true);

    // Set frame.
    void SetFrame(uint frame);

    // Set frame color.
    void SetColor(const Color &color);

    // Set meta position.
    void SetMetaPos(const MetaPos &metaPos);

    // Internal.
    void *operator () () const { return (void *)wobj; }

    // Construct image element. [imageElem] is image element. [name] is name of image asset. [z] is z order. 
    // Higher z overlays lower z.[baseFrame] is rectangle of first animation frame in image. Use coordinates
    // of 1920x1080 version for all resolutions. [cols] is number of animation frame columns. [frameCount] is 
    // total number of frames.
    ImageElem(wcstr name, uint z, const B2i &baseFrame = B2i(), uint cols = 1, uint frameCount = 1);

    // Destructor.
    ~ImageElem();

private:
    byte wobj[96];
};