Sprites are elementary parts of many applications. They can be used for many different purposes and Hollywood is very flexible with them because they are implemented fully in software. Thus, there are no restrictions on sprite size, colors, transparency and so on. Traditionally, sprites are used for player and enemy graphics in games but they also come handy in many other situations.
Generally spoken, sprites have three distinctive attributes which distinguishes them from brushes:
A more detailed explanation of sprite features follows below.
LoadBrush(1, "test.iff") LoadSprite(1, "test2.iff") DisplaySprite(1, 0, 0) DisplayBrush(1, 0, 0)
You see that we load two images: Brush 1 and sprite 1. Now we draw sprite 1 and after that we draw brush 1. Normally, brush 1 should be drawn over sprite 1 because it DisplayBrush() is called after DisplaySprite(). Sprites, however, are always on the front of the display and that is why in this special case, brush 1 is drawn behind sprite 1.
This applies to all normal graphics commands of Hollywood: You can never draw graphics over a sprite! Sprites are always on the front and normal functions, i.e. non-sprite functions, can never paint sprites over. You can only draw sprites over with new sprites.
LoadSprite(1, "test.iff") DisplaySprite(1, 0, 0) DisplaySprite(1, 100, 100)
You see that we display sprite 1 two times. First, it is displayed at 0:0 and second, it is displayed at 100:100. Because every sprite can only be on the screen once, the second call to DisplaySprite() will not draw sprite 1 again but move it from 0:0 to 100:100 instead. DisplaySprite() checks if sprite 1 is on the screen, and if it is, it is picked up and moved to the new position. Thus, you can easily move your sprites around on the screen.
Additional information on the sprite implementation in Hollywood: