Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setSpriteVisibility()

Purpose

Hide or reveal a sprite

Description

Sets the visibility of a sprite. If false then the sprite is not displayed

Syntax

setSpriteVisibility( sprite, visibility )

sprite.visible = show

Arguments

sprite handle of the sprite

visibility if true then the sprite is displayed

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, "Press the A button to show sprite" )
    setSpriteVisibility( enemy, c.a )
    updateSprites()
    drawSprites()
    update()
repeat

Associated Commands

getSpriteVisibility()

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.