Portable Game Console
PoGa-4DGL Reference Manual
Note that the sprite is always represented within a 16x16 pixel block. The sprite can be smaller than 16x16
by nominating one of the colours to be a 'transparent' colour which will stop that colour being written to
the screen. In the case of the cherry example, if the 'black' background is nominated as the 'transparent'
colour it will not be drawn, so only the red, green and white pixels will be written to the screen allowing it
to overlay other images. Another thing to note, the cherry is centred, allowing rotation or mirroring without
the image shifting from its central position.
We will now jump right in the deep end and create the cherry sprite using the Sprite Editor, and write a
simple program in 4DGL to display it. The explanation of how it all works will unfold as you go.
7.1 Making your First Sprite
First, from the Workshop tool bar, open the Sprite Editor.
Start a new file.
© 2011 4D Systems
www.4dsystems.com.au
Page 53 of 87