Basics
package basics
import kotlin.browser.document
import kotlin.js.json
fun main(args: Array<String>) {
val app = PIXI.Application(800, 600, json(
"backgroundColor" to 0x1099bb
))
document.body!!.appendChild(app.view)
val bunny = PIXI.Sprite.fromImage("../assets/basics/bunny.png")
bunny.anchor.set(0.5)
bunny.x = app.screen.width.toDouble() / 2
bunny.y = app.screen.height.toDouble() / 2
app.stage.addChild(bunny)
app.ticker.add({ delta ->
bunny.rotation = bunny.rotation.toDouble() + 0.1 * delta.toDouble()
});
}