Portable Game Console
PoGa-4DGL Reference Manual
We will now create a simple 4DGL program to display the cherry sprite.
Open the 4D Workshop, start a new file.
Select the new file to be a 4DGL program file.
Type the following code into the editor.
#inherit "4DGL_16bitColours.fnc" // we need the colour list for the sprites CLUT
#inherit "Demo.inc" // inherit the demo sprite bitmaps
func main()
// first, set the pointers for the sprite generator
gfx_SpriteSet(demo_sprites, demo_colors, demo_palette);
// display the cherry sprite at 50,50
gfx_BlitSprite(S_Cherry, P_Cherry, 56, 10, NORTH);
repeat forever // stop
endfunc
© 2011 4D Systems
www.4dsystems.com.au
Page 59 of 87