Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setShapeTint()

Purpose

Applies a tint (colour) to a shape

Description

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

Syntax

setShapeTint( shape, tint )

Arguments

shape Handle which stores the shape in question

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

Example

gw = gWidth()
gh = gHeight()
tint = white
press = false

shape = createTriangle( gw / 3, gh / 3, gw - gw / 3, gh / 3, gw / 2, gh - gh / 4 )

cols = [ red, green, blue ]
for i = 0 to len( cols ) loop
    setVertexColour( shape, i, cols[i] )
repeat

loop
    clear()
    j = controls( 0 )
    if j.a and !press then
        tint = { random( 1.0 ), random( 1.0 ), random( 1.0 ), 1 }
        setShapeTint( shape, tint )
        press = true
    endif   
    if !j.a then
        press = false
    endif   
    drawShape( shape )
    printAt( 0, 0, "Press the A button to change the shape tint" )
    printAt( 0, 2, "Current tint colour RGBA vector: ", tint )
    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.