Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

drawSprite()

Purpose

Draw the specified sprite

Description

Draw only the specified sprite in the current position, orientation and colour

Syntax

drawSprite( sprite )

Arguments

sprite handle of the sprite

Example

image = loadImage( "Untied Games/Enemy A", false )
enemy = []
for i = 0 to 4 loop
    enemy[i] = createSprite()
    setSpriteImage( enemy[i], image )
    setSpriteAnimation( enemy[i], 0, 4, 20 )
    setSpriteLocation( enemy[i], { ( i % 2 ) * 400 + 400, int(i / 2) * 300 + 200 } )
    setSpriteScale( enemy[i], { 4, 4 } )
repeat

loop
    clear()
    printAt( 0, 0, "Press buttons X, A, Y and B to draw sprites")
    updateSprite( enemy[1] )
    updateSprite( enemy[2], deltaTime() / 2 )
    updateSprite( enemy[3], deltaTime() * 2 )
    c = controls(0)
    if c.x then
        drawSprite( enemy[0] )
    endif
    if c.a then
        drawSprite( enemy[1] )
    endif
    if c.b then
        drawSprite( enemy[2] )
    endif
    if c.y then
        drawSprite( enemy[3] )
    endif
    update()
repeat

Associated Commands

createSprite(), deltaTime(), drawSprite(), drawSprites(), removeSprite(), updateSprites(), updateSprite()

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.