Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

getSpriteImageSize()

Purpose

Get the size of the image associated with a sprite

Description

Get the size of the original image that was used to create the specified sprite or the tile size if an animation has been set

Syntax

size = getSpriteImageSize( sprite )

Arguments

sprite The handle of the sprite

size A vector containing the width and height of the original image { x, y } or the tile size

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 )
isize = getSpriteImageSize( explosion )
tiles = ( isize.x / tsize.x ) * ( isize.y / tsize.y )
setSpriteAnimation( explosion, 0, tiles, 60 )

for i = 0 to tiles loop
    clear()
    updateSprites()
    drawSprites()
    update()
repeat

Associated Commands

getSpriteImage(), setSpriteImage()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.