class Graphics : Closeable
Use this class to draw on a window.
Graphics(window: Window)
Use this class to draw on a window. |
var backgroundColor: Color
Background color. |
|
var color: Color
Color of the pen. |
|
val window: Window |
fun clear(): Unit
Fills the window with background color |
|
fun close(): Unit
Finish drawing. |
|
fun drawDot(x: Int, y: Int): Unit
Draws a dot. |
|
fun drawImage(x: Int, y: Int, image: Image): Unit
Draws an image. fun drawImage(x: Int, y: Int, image: Image, angle: Double, anchorx: Int = 0, anchory: Int = 0): Unit
Draws rotated image. |
|
fun drawLine(x1: Int, y1: Int, x2: Int, y2: Int): Unit
Draws line from x1,y1 to x2,y2. |
|
fun drawOval(x: Int, y: Int, width: Int, height: Int, fill: Boolean = false): Unit
Draws oval inside invisible rect. |
|
fun drawRect(x: Int, y: Int, width: Int, height: Int, fill: Boolean = false): Unit
Draws a rect. |
|
fun drawText(x: Int, y: Int, text: String): Unit
Draws the text. |
|
fun setFontSize(size: Int): Unit
Change size of the current font |
|
fun setStrokeWidth(width: Int): Unit
Change current width of lines and size of dots |
fun Graphics.drawAnimation(x: Int, y: Int, animation: Animation): Unit
Draws current frame from animation. fun Graphics.drawAnimation(x: Int, y: Int, animation: Animation, angle: Double, anchorx: Int = 0, anchory: Int = 0): Unit
Draws rotated animation. |
|
fun Graphics.drawDot(p: Point): Unit |
|
fun Graphics.drawImage(p: Point, image: Image): Unit fun Graphics.drawImage(p: Point, image: Image, angle: Double, anchorx: Int = 0, anchory: Int = 0): Unit |
|
fun Graphics.drawLine(p1: Point, p2: Point): Unit |
|
fun Graphics.drawOval(r: Rect, fill: Boolean = false): Unit fun Graphics.drawOval(topLeft: Point, size: Vector, fill: Boolean = false): Unit |
|
fun Graphics.drawRect(r: Rect, fill: Boolean = false): Unit fun Graphics.drawRect(topLeft: Point, size: Vector, fill: Boolean = false): Unit |
|
fun Graphics.drawText(p: Point, text: String): Unit |