Class: TGraphicSprite

Declaration: Sprites.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TSprite

Inherited By:

None.

Purpose:

TGraphicSprite is a concrete class, derived from TSprite, that represents a specific graphic used as a sprite on the desktop. Because it derives from TCompositingLayer, it knows whether to be displayed on top of or underneath the other graphic objects (which are also derived classes of TCompositingLayer) on the desktop as it is moved around.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TGraphicSprite::TGraphicSprite

  1. TGraphicSprite ()
  2. TGraphicSprite (const TCompositingLayer &, bool placeNewSpriteAbove =false)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructor that places a new sprite above or below the given item, depending upon the value of the given Boolean. The given item might be another sprite or some other derived TCompositingLayer.

Calling Context:

  1. Called by the stream-in operators. You can also call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicSprite::~TGraphicSprite

virtual ~ TGraphicSprite ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicSprite::SetGraphic

virtual void SetGraphic (const MDrawable &)

Interface Category:

API.

Purpose:

Sets the graphic displayed by this sprite to the given graphic. If the sprite is visible, the new graphic is displayed on the device at the current location.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicSprite::CopyGraphic

virtual MDrawable * CopyGraphic () const

Interface Category:

API.

Purpose:

Returns a cloned copy of the graphic that is displayed by this sprite.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to an MDrawable object that represents the graphic displayed by this sprite.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicSprite::SetLocation

virtual void SetLocation (const TGPoint & worldCoordinate)

Interface Category:

API.

Purpose:

Sets the location of the sprite to the given TGPoint, expressed in world coordinates. The origin of the sprite's graphic is aligned with this point. If the sprite is visible and the graphic is set, the sprite is displayed at the new location on the device. This function can be called repeatedly to move the sprite around the desktop.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicSprite::SetVisibility

virtual void SetVisibility (bool)

Interface Category:

API.

Purpose:

Sets the visibility of the sprite to the given Boolean. If the Boolean is true, the sprite is visible; if it is false, the sprite is invisible. If the graphic is set and the new visibility value is different from the previous value, then the sprite is displayed or erased as required.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.