Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

getSpriteVisibility()

Purpose

Find out if a sprite is visible

Description

Get the current visibility state of the specified sprite

Syntax

shown = getSpriteVisibility( sprite )

shown = sprite.visible

Arguments

sprite handle of the sprite

shown if the sprite is currently visible

Example

image = loadImage( "Untied Games/Enemy A", false )
enemy = createSprite()
setSpriteImage( enemy, image )
speed = 20
setSpriteAnimation( enemy, 0, 4, speed )
lastpos = { gWidth() / 2, gHeight() / 2 }
setSpriteLocation( enemy, lastpos )
setSpriteScale( enemy, { 8, 8 } )

loop
    clear()
    c = controls( 0 )
    printAt( 0, 0, "Hold down the A button to show  the sprite" )
    setSpriteVisibility( enemy, c.a )
    visible = getSpriteVisibility( enemy )
    if visible then
        printAt( 0, 1, "Sprite is visible" )
    else
        printAt( 0, 1, "Sprite is invisible" )
    endIf
    updateSprites()
    drawSprites()
    update()
repeat

Associated Commands

setSpriteVisibility()

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.