BB___DRAWSPRITES

=DRAWSPRITES= toc

Description
> This command updates the sprite display and is therefore mandatory when using sprites. All the visible sprites will be drawn on the BACKGROUND. Without this command you will not see the sprites or the BACKGROUND.

Syntax

 * 1) print #WindowHandle.controlHandle, "Drawsprites"
 * 2) #WindowHandle.controlHandle "Drawsprites"

Hints
> DRAWSPRITES is mostly used in timed loops with the help of the TIMER.

Example
//BMP files that will be used in the example below://


 * [[image:sprite_jb_back.bmp width="100"]] ||  || [[image:sprite_jb_guy_1.bmp height="70"]] ||

//This example uses the images from this article. Save them to a folder of your choice and run this code from the same folder.// code format="lb" NOMAINWIN LOADBMP "BMP1","sprite_jb_back.bmp" LOADBMP "BMP2","sprite_jb_guy_1.bmp"

Open "Just BASIC - Sprite Demo - Drawsprites" For Graphics_nsb_nf as #main #main "Trapclose [quit]" #main "Background BMP1" #main "AddSprite player BMP2"

' go to the redraw branch every 56 milliseconds Timer 56,[redraw] Wait

[redraw] ' the Drawsprites command is issued every 56 milliseconds #main "Drawsprites" Wait

[quit] Timer 0 Close #main UNLOADBMP "BMP1" UNLOADBMP "BMP2" End code

Useful Functions
code format="lb" Place a useful function using this keyword here code