Detailed API documentation.

Graphics class is like a pen you use to draw on the window using a Cartesian coordinate system. Thus, you have to read the Coordinate System.

You create an object of Graphics class passing the window as an argument and use its methods to do the drawing. Here is an example:

import com.anysolo.toyGraphics.*

fun main() {
    val wnd = Window(500, 500)
    val gc = Graphics(wnd)

    gc.drawRect(50, 50, 100, 50)

    gc.color =
    gc.drawLine(50, 350, 400, 450)

    gc.color =
    gc.drawOval(350, 300, 100, 50)

    gc.color =
    gc.drawText(150, 200, "Some text")

Read API documentation to learn more about Graphics methods.