struct CCL::ISprite

Overview

Sprite interface. More…

#include <isprite.h>

struct ISprite: public CCL::IUnknown
{
    // enums

    enum Options;

    // methods

    virtual tresult CCL_API construct (
        IView* view,
        RectRef size = Rect (),
        IDrawable* drawable = nullptr,
        int options = 0
    ) = 0;

    virtual RectRef CCL_API getSize () const = 0;
    virtual IDrawable*CCL_API getDrawable () const = 0;
    virtual tbool CCL_API isVisible () const = 0;
    virtual void CCL_API show () = 0;
    virtual void CCL_API hide () = 0;
    virtual void CCL_API move (RectRef size) = 0;
    virtual void CCL_API moveTo (PointRef position) = 0;
    virtual void CCL_API scrolled (PointRef delta) = 0;
    virtual void CCL_API refresh () = 0;
    virtual void CCL_API takeOpacity (IDrawable* drawable) = 0;
};

Inherited Members

public:
    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;

Detailed Documentation

Sprite interface.

Methods

virtual tresult CCL_API construct (
    IView* view,
    RectRef size = Rect (),
    IDrawable* drawable = nullptr,
    int options = 0
) = 0

Initialize sprite.

virtual RectRef CCL_API getSize () const = 0

Get current size.

virtual IDrawable*CCL_API getDrawable () const = 0

Get associated IDrawable.

virtual tbool CCL_API isVisible () const = 0

Check if sprite is currently visible.

virtual void CCL_API show () = 0

Show sprite.

virtual void CCL_API hide () = 0

Hide sprite.

virtual void CCL_API move (RectRef size) = 0

Move (and resize) sprite.

virtual void CCL_API moveTo (PointRef position) = 0

Move sprite.

virtual void CCL_API scrolled (PointRef delta) = 0

Inform sprite that is has been scrolled on screen.

virtual void CCL_API refresh () = 0

Inform sprite that the drawable has changed.

virtual void CCL_API takeOpacity (IDrawable* drawable) = 0

Let drawable take opacity from its content, implemented only in certain sprite classes.