correct. the image remains available (using its ID) until you explicitly delete it.
deleting the sprite only deletes the sprite/reference to it.
SetErrorMode(2)
// set window properties
SetWindowTitle( "DeleteSprite" )
SetWindowSize( 640,360, 0 )
SetWindowAllowResize( 1 )
// set display properties
SetVirtualResolution( 640,360 )
SetOrientationAllowed( 1, 1, 1, 1 ) // portrait, portrait2, landscape, landscape2
SetSyncRate( 30, 0 )
SetScissor( 0,0,0,0 )
UseNewDefaultFonts( 1 )
CenterWindow()
GLOBAL ThisIMG
ThisIMG = CreateImageColor(255,0,0,255)
GLOBAL Last#, Sprites as Integer []
AddSprite()
do
Print("Click to Delete Sprite")
If Last# + 1 <= Timer() and Sprites.Length < 10
AddSprite()
Last# = Timer()
EndIf
If GetPointerPressed() and Sprites.Length > -1
ThisSPR = Random(0,Sprites.Length)
DeleteSprite( Sprites[ThisSPR])
Sprites.Remove(ThisSPR)
EndIf
Print(GetImageExists(ThisIMG))
Sync()
loop
Function AddSprite()
If Sprites.Length > -1
ThisSPR = CloneSprite(Sprites[0])
Else
ThisSPR = CreateSprite(ThisIMG)
SetSpriteSize(ThisSPR,64,64)
EndIf
Sprites.Insert(ThisSPR)
SetSpritePositionByOffset(ThisSPR, Random(100,540), Random(100,260))
EndFunction
Function CenterWindow()
X = GetMaxDeviceWidth()/2.0 - GetWindowWidth()/2.0
Y = GetMaxDeviceHeight()/2.0 - GetWindowHeight()/2.0
SetWindowPosition( X,Y)
EndFunction
btw, if you
use Discord, it may be easier for you/us to chat