Unverified Commit e5421fa9 authored by Yufui Glen's avatar Yufui Glen Committed by GitHub

Correct code sample in README (#9)

parent 1740a913
......@@ -21,6 +21,30 @@ fun main(args: Array<String>) {
setSize(800, 600)
}
}
class Renderer(val displayScene: (Renderer, Int, Int) -> Unit): SkiaRenderer {
val paint = Paint().apply {
setColor(0xff9BC730L.toInt())
setMode(PaintMode.FILL)
setStrokeWidth(1f)
}
var canvas: Canvas? = null
override fun onInit() {
}
override fun onDispose() {
}
override fun onReshape(width: Int, height: Int) {
}
override fun onRender(canvas: Canvas, width: Int, height: Int) {
this.canvas = canvas
displayScene(this, width, height)
}
}
```
With the following `build.gradle`:
```groovy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment