getSpriteImage()
Purpose
Get the image associated with a sprite
Description
Get the original image that was used to create the specified sprite
Syntax
image = getSpriteImage( sprite )
image = sprite.image
Arguments
sprite The handle of the sprite
image The handle of the associated image
Example
image = loadImage( "Untied Games/Explosion 01", false )
explosion = createsprite()
setSpriteImage( explosion, image )
setSpriteLocation( explosion, { gWidth() / 2, gHeight() / 2 } )
setSpriteScale( explosion, { 5, 5 } )
tsize = tileSize( image, 0 )
spriteImage = getSpriteImage( explosion )
isize = imageSize( spriteimage )
tiles = ( isize.x / tsize.x ) * ( isize.y / tsize.y )
setSpriteAnimation( explosion, 0, tiles - 1, 60 )
for i = 0 to tiles loop
clear()
updateSprites()
drawSprites()
update()
repeat
Associated Commands