Intel Animation for Java* Package TutorialLesson 2: Using StaticDataSpritesThis applet shows four Sprites. Sprites are the building blocks of an animation display. Every visible object in an animation display is a sprite. This applet uses four StaticDataSprites: the sky, the buildings, the floor, and Elvis. (There are two types of Sprites: StaticDataSprites and DynamicDataSprites. DynamicDataSprites and the difference between the two types of Sprites will be discussed later.) The following needs to be done to create a Sprite: 1. Create an awt.Image
2. Create a SingleImage
3. Optionally set the transparency color of the SingleImage (see Notes on Transparency Color)
4. Create the sprite
5. Assign the SingleImage to the sprite
6. Set the destination of the sprite to a surface
7. Position the sprite on the surface (see Notes on Coordinate System below)
8. Repaint the animCanvas (which causes all the sprites to be drawn in the right order)
Notes on Transparency Notes on Coordinate System Coordinate systems in Intel Animation for Java have the following characteristics:
This applet sets the transparency color to the color of the first pixel in the awt.Image. See the source code for more details.
This page was last updated on Feb 11th, 1997.
|