Creates a dummy sprite. Dummy sprites behave as normal sprites but have no image or other visual aspect to them. They will not be drawn even if an image is assigned to them.
class function CreateDummy(const Owner: TAgkObject): TAgkSprite; static;
Parameters |
Description |
const Owner: TAgkObject |
the owner of the new sprite (eg. a TAgkScene object). |
Dummy sprited are useful for adding physics objects to a scene without needing visuals to accompany the physics shape. You can use the physics contact and feedback commands to work out what has hit these hidden physics shapes if desired. If you do not need to know what has hit your hidden shapes then you can add them all to a single dummy sprite using the AddShape* methods for best performance.
Shape will not work on dummy sprites as they have no image to calculate a shape, shapes must be defined manually using SetShapeBox, SetShapeCircle or SetShapePolygon.
Dummy sprites will not update their stored angle and position with the latest physics versions, so the properties X, Y, or Angle will return the last value you set. Setting the sprite's position will update the physics body to the position you set.
Copyright (c) 2012. All rights reserved.
|