Page 1 of 1

Posted: Thu Oct 10, 2002 9:21 am
by BackupUser
Restored from previous forum. Originally posted by WolfgangS.

Hi !
How is the fastest way to clear a Sprite ?
Delete it and create a new one ? Or copy an other Sprite on it ?
Or an other way ?

Best regards & MFG
:)WolfgangS

Posted: Thu Oct 10, 2002 9:43 am
by BackupUser
Restored from previous forum. Originally posted by Pupil.
Originally posted by WolfgangS

Hi !
How is the fastest way to clear a Sprite ?
Delete it and create a new one ? Or copy an other Sprite on it ?
Or an other way ?
:)WolfgangS
I don't know which is fastest, but if you just want to clear out all data in the sprite and keep the sprite number, you don't have to delete it first you just create a new one on top of the old one, PB internally deletes sprites if you use the same spriteindex number. If my writing is incomprehensable maybe an example would help:

Code: Select all

#SPRITEINDEX = 20 ; just some number for the example.

LoadSprite(#SPRITEINDEX, "sprite.bmp") ; Ok we got a sprite.
 ...
; Now to clear this sprite:
CreateSprite(#SPRITEINDEX, SpriteWidth(#SPRITEINDEX), SpriteHeight(#SPRITEINDEX))
; Ok so now we have a clean sheet
Hope i didn't missunderstood what yuo were looking for..