Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setShapeColour()

Purpose

Applies a colour to a shape

Description

Used to apply a colour vector (RGBA) to a shape drawn with drawShape()

Syntax

setShapeColour( shape, colour )

Arguments

shape Handle which stores the shape in question

colour RGBA vector which describes the colour to be applied to the supplied shape

Example

gw = gWidth()
gh = gHeight()

shape = createBox( gw / 2, gh / 2, gw / 2, gh / 2 )
press = false
col = white

loop
    clear()
    j = controls( 0 )

    if j.a and !press then
        col = { random( 1.0 ), random( 1.0 ), random( 1.0 ), 1 }
        setShapeColour( shape, col )
        press = true
    endif

    if !j.a then
        press = false
    endif

    drawShape( shape )
    printAt( 0, 1, "Press the A button to change the shape colour!" )
    printAt( 0, 3, "Current shape colour RGBA vector: ", col )
    update()
repeat

Associated Commands

copyShape(), createBox(), createCircle(), createCurve(), createLine(), createLineStrip(), createPoly(), createStar(), createTriangle(), deleteShape(), drawShape(), getShapeBounds(), getShapeLocation(), getShapeRotation(), getShapeScale(), getShapeTint(), getVertex(), getVertexColour(), getVertexLineColour(), getVertexLineThickness(), joinShapes(), moveShape(), numVerts(), rotateShape(), scaleShape(), setShapeColour(), setShapeLineStyle(), setShapeRotation(), setShapeScale(), setShapeScaleModeLocal(), setVertex(), setVertexColour(), setVertexLineStyle()

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.