setShapeLineStyle()

Purpose

Set the draw style for the outline of a shape

Description

Used to change the colour and thickness of the outline in a shape drawn with drawShape()

Syntax

setShapeLineStyle( shape, thickness, tint )

Arguments

shape Handle which stores the shape in question

thickness Float describing the thickness (in pixels, from the centre of the line outward) of the line

tint Vector (RGBA) to set the colour of the outline

Example

gw = gWidth()
gh = gHeight()

shape = createBox( gw / 2, gh / 2, gw / 2, gh / 2 ) 
col = black
thickness = 1
press = false

ink( black )
loop
    clear( bisque )
    j = controls( 0 )

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

    if !j.a then
        press = false
    endif

    thickness += j.ly   

    setShapeLineStyle( shape, thickness, col )
    drawShape( shape )

    printAt( 0, 0, "Move the left control stick up or down to adjust outline thickness." )
    printAt( 0, 1, "Current line thickness: ", thickness )

    printAt( 0, 3, "Press the A button to change the outline colour." )
    printAt( 0, 4, "Current shape outline 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(), setShapeRotation(), setShapeScale(), setShapeScaleModeLocal(), setShapeTint(), setVertex(), setVertexColour(), setVertexLineStyle()