Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

Graphics

This contains all of the functions you can use for drawing to the screen. This includes being able to alter the drawing color (using setColor), set the font, drawImages, and being able to draw various shapes.

All of the graphics commands are also available as methods that you can use on the Image class.

Many drawing commands have two versions, a fill and draw version. For example fillRect and drawRect. The fill version always 'fills' the shape with colour, whilst the draw version draws an outline.

The 'set' commands also take blocks, and will reset the value once the block ends. This allows you to set a color, font or blend for one section of code.

// an example of calling some drawing commands
fill( :black )

setColor( :white )
fillRect( 0, 0, 100, 100 )

setColor( :red ) do
    drawCircle( 50, 50, 100, 100, true )
end

Using Colors

How Alignment Works

Image Class

Transformations

setAlpha

multAlpha

setColor

setFont

setBlend

getAlpha

getColors

getRed

getGreen

getBlue

drawImage

drawRotatedImage

drawLine

drawPixel

drawCircle

drawEllipse

drawPolygon

drawRect

drawRoundedRect

drawSegment

drawInnerSegment

drawText

fill

fillCircle

fillEllipse

fillPolygon

fillRect

fillRoundedRect

fillSegment

fillInnerSegment

fillText