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.
- TGraphicSprite ()
- TGraphicSprite (const TCompositingLayer &, bool placeNewSpriteAbove =false)
Interface Category:
API.
Purpose:
- Default constructor.
- 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:
- Called by the stream-in operators. You can also call this function directly.
- Call this function directly.
Parameters:
- Takes no parameters.
- const TCompositingLayer & -The destination compositing layer list.
- bool placeNewSpriteAbove =false -A Boolean flag, that, when set to the default value of false, causes the sprite to be placed below the composited object specified by the first parameter.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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:
- const MDrawable & -The graphic to be displayed by this sprite.
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:
- const TGPoint & worldCoordinate -The new location for the sprite. The location of the sprite's graphic is aligned with this point.
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:
- bool -A Boolean flag, that when true, sets the sprite to be visible, and when false, sets it to be invisible.
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.