Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <W32STD.H>

Class RWsSprite

class RWsSprite : public RWsSpriteBase;

Description

Sprite.

This class defines functions to create and initialise a sprite, and to set its position.

Derivation

Members

Defined in RWsSprite:

Inherited from MWsClientClass:

Inherited from RWsSpriteBase:


Construction and destruction


RWsSprite()

IMPORT_C RWsSprite();

Description

Default C++ constructor.

This allows classes that contain an RWsSprite to be constructed before an RWsSession exists.

Note: do not use this version of the constructor on its own. Before an RWsSprite object can be used it must be constructed using the RWsSprite(RWsSession) constructor. An example of this might be as follows:

RWsSprite iSprite;
iSprite=RWsSprite(iWsSession);

RWsSprite(RWsSession &)

IMPORT_C RWsSprite(RWsSession &aWs);

Description

Constructs a sprite with a window server session.

Initialisation must be completed using the RWsSprite::Construct(RWindowTreeNode &,const TPoint &,TInt) function before the sprite can be activated using RWsSpriteBase::Activate().

Parameters

RWsSession &aWs

The window server session owning the sprite.

[Top]


Member functions


Construct(RWindowTreeNode &,const TPoint &,TInt)

IMPORT_C TInt Construct(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aFlags);

Description

Completes the construction of a sprite.

This function must be called before a sprite is activated using RWsSpriteBase::Activate().

It always causes a flush of the window server buffer.

Parameters

RWindowTreeNode &aWindow

The window in which the sprite is displayed.

const TPoint &aPos

The position of the sprite's origin relative to aWindow's origin. The origin is the top left corner of the window.

TInt aFlags

Any one of the TSpriteFlags values, or a combination of the flags, using a bit-wise OR operation.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.

See also:


SetPosition(const TPoint &)

IMPORT_C void SetPosition(const TPoint &aPos);

Description

Sets the sprite's position.

This function can be called before or after the sprite has been activated.

Note: the sprite's initial position is set when the sprite is constructed (see RWsSprite::Construct(RWindowTreeNode &,const TPoint &,TInt)).

Parameters

const TPoint &aPos

Position of the sprite's origin relative to the origin of the window that owns it. The origin is the top left corner of the window.