Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: w32std.h
Link against: ws32.lib

Class RWsSprite

RWsSprite

Support

Supported from 5.0

Description

Sprite.

This class defines functions to create and initialise a sprite, and to set its position. It also inherits the functions of RWsSpriteBase.

Derivation

MWsClientClassBase class for all classes whose objects are clients of the window server engine
RWsSpriteSprite
RWsSpriteBaseSprite base class

Defined in RWsSprite:
Construct(), RWsSprite(), SetPosition()

Inherited from MWsClientClass:
WsHandle()

Inherited from RWsSpriteBase:
Activate(), AppendMember(), Close(), UpdateMember()


Construction and destruction


RWsSprite()

RWsSprite();

Description

Default C++ constructor.

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

Note:

RWsSprite iSprite;
iSprite=RWsSprite(iWsSession);


RWsSprite()

RWsSprite(RWsSession &aWs);

Description

Constructs a sprite with a window server session.

Initialisation must be completed using the Construct() function before the sprite can be activated using RWsSpriteBase::Activate().

Parameters

RWsSession &aWs

The window server session owning the sprite.


Construct()

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().

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:

[Top]


Position Control


SetPosition()

void SetPosition(const TPoint &aPos);

Description

Sets the sprite position.

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

Note:

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.