Sprites were introducted in QuickTime 2.5 and have since been enhanced in later versions of QuickTime.
The metaphor of a sprite animation as a theatrical play is used, in which sprite tracks are characterized as the boundaries of the stage and a sprite world or a
as the stage itself. To extend the metaphor, you may want to think of
sprites as actors performing on that stage.
Each sprite has that describe its location
and appearance at a given time. During an animation sequence, modifying the sprite’s properties causes it to change its appearance and move around the screen.
Sprites may be mixed with still–image graphics to produce a wide variety of effects while using relatively little memory.
The QTPlugin provides the developers with the Sprite Framework to add sprite–based animation to their applications.
The Sprite Framework, which is a set of classes,
handles all the tasks necessary to compose and modify sprites, their backgrounds and properties, in addition to transferring the results to the
screen or to an alternate destination.
The QTPlgMediaSprite class is part of the Sprite Framework and defines a
that describes sprites
sample data. This class implements properties and methods that allows you to deal with characteristics peculiar to sprite samples.
→
→
The
QTPlgMediaSprite class constructors are called when you create a new instance of the class, while
the
˜QTPlgMediaSprite class destructor, is called automatically when the
class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to
nil.
You can not create a
QTPlgMediaSprite object by yourself; instead, you will use class instances obtained from
objects of appropriate type.
Once a new class instance is returned, it is good practice to check the
class property to
be sure that the new object can be used. See the
validity requirements for more details.
The class provides you with the following initializer methods:
This is the copy constructor. The properties of the object to be copied will be used to initialize the
new class instance properties
specifies the number of images that currently exist in a sprite track. The value of this property reflects the number
of images that currently exist based on the key frame that is in effect
specifies the desired bit depth of the offscreen graphics world where the sprite data is drawn before it is copied to the screen. The default value is
0 (which means to use the bit depth of the deepest monitor that intersects the onscreen sprite window).
Setting this property can save memory if your sprite graphics are drawn at a lower bit depth than the user’s monitor
indicates the desired frequency at which the sprite media handler should send idle events to the sprite track.
The default value is –1 (which means not to issue any idle events)
specifies a solid background color for the entire sprite track
indicates how the sprite media handler interprets override samples. If this property is set to true, then the sprite media handler
generates the sprite data for a particular override sample by applying the changes in that override sample directly
to the key frame sample, ignoring any previous override samples. (This is the default mode.) On the other hand, if this property is set to false,
then the sprite media handler generates sprite data by applying the changes in a particular override sample to the data generated by applying the changes
in all previous override samples to the key frame sample data. In other words, true specifies that a particular override frame
contains absolute changes to key frame data, while false specifies relative changes.
specifies whether the sprites in the sprite track are rescaled whenever the sprite track is resized.
The default value is false
specifies whether the sprite track contains any wired actions
specifies whether the sprite track is visible. The default value is true. It might occasionally be useful to set the sprite track to be
invisible if there are other tracks in the movie and you want to allow the user to click on items in
those tracks (by putting an invisible sprite track in front that intercepts those clicks)
provides detailed informations about the stored sprites sample data descriptions
provides detailed informations about the stored sprites sample data; returns a list of
objects
allows to retrieve or set the properties of sprites that currently exist in a sprite track.
The list of objects
returned by this property reflects the number of sprites that currently exist based on the key frame that is in effect
retrieves the sprite media sample that is currently being displayed
returns the list of sprites objects constituting the
sample identified by the index
i. The index range from
0 to
–1
allows you to determine whether the user has clicked on a sprite. This method looks at each one of the sprites
in a sprite track to see whether it is currently at the location specified by the
point; the location
must be expressed in coordinates
local to the sprite track. If more than one sprite is situated at that location, then
the result is set to the properties of the frontmost sprite (that is, the sprite with the lowest
).
This method accepts clicks only on a non–transparent part of a sprite and checks for both
sprites
allows you to notify the sprite media handler to use the video track specified by the
videoTrack parameter as
the source for the sprite’s image identified by the
spriteImageId parameter that
corresponds to the .
The video track and the sprite track has to be contained into the same QuickTime movie