Wheel IDE

Online demo »

Screen, circles

Circle example

This example shows how draw black and white, filled and line circles.

Code

#project "Screen circle example"

#include "lib/modules/standard.whl"
#include "lib/modules/device.whl"
#include "lib/modules/screen.whl"

#display "EV3"

proc main()
    ; Select the EV3 device in the simulator...
    selectDevice(DEVICE_EV3)

    ; Draw two black filled rectangles at the left/top and right/bottom...
    setFill(TRUE)
    setFillColor(BLACK)
    drawRect(0, 0, 89, 64)
    drawRect(89, 64, 89, 64)

    ; Draw a white line circle at the left/top...
    setFill(FALSE)
    setFillColor(WHITE)
    drawCircle(45, 32, 24)

    ; Draw a white filled circle at the right/bottom...
    setFill(TRUE)
    drawCircle(134, 96, 24)

    ; Draw a black filled circle at the right/top...
    setFillColor(BLACK)
    drawCircle(134, 32, 24)

    ; Draw a black line circle at the left/bottom...
    setFill(FALSE)
    drawCircle(45, 96, 24)

    updateScreen()

    ; Wait...
    halt()
end

Screenshot

See also: Modules