Game Development Reference
In-Depth Information
Sprite, in detail
Let us start with explaining what a sprite is. A sprite is a commonly used basic
term in 2D graphics, which usually refers to any visual element on the stage such
as images, or buttons, text field, etc. Sprite does not usually have a strict definition.
Sprites are used anywhere from drawing your game's characters, to splash screens
to a score display, etc. Sprites in AS3 can usually be moved around the screen,
responding to mouse events as well as keyboard events.
Which way is up?
The following illustrates the stage of any Flash application. Notice the origin is at the
top left-hand corner and how values for X and Y increase. The larger the value of
X farther to the right of the screen larger is the value of Y lower to the bottom of
the screen.
A sprite is drawn onto a stage. The stage is your area where you are allowed to
draw and receive mouse and keyboard events. Each sprite among numerous other
properties have x, y, width, height, and children. In AS3, there could be hundreds of
sprites being displayed at any given moment. However, it is good to know that more
the number of sprites on the stage and moving lower is the performance.
 
Search WWH ::




Custom Search