Last active
June 12, 2022 23:17
-
-
Save dmitrykolesnikovich/cf39859d29f1a78a5a8913e1d0920a32 to your computer and use it in GitHub Desktop.
Featurea Text Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package featurea.examples.text | |
import featurea.app.* | |
import featurea.examples.text.Resources.* | |
import featurea.graphics.* | |
import featurea.input.* | |
import featurea.runtime.* | |
object Resources { | |
val enemyPng = "images/enemy.png" | |
val heroPng = "images/hero.png" | |
} | |
context(Bootstrap) | |
fun main() { | |
export(featurea.app.components) | |
export(featurea.graphics.components) | |
export(featurea.input.components) | |
upload(spriteShader) | |
upload(fontShader) | |
upload(primitiveShader) | |
upload(heroPng) | |
upload(enemyPng) | |
val app: Application = import() | |
val graphics: Graphics = import() | |
val input: Input = import() | |
/*example*/ | |
val point: Point = Point() | |
app.repeatOnUpdate { | |
graphics.clear() | |
graphics.drawText("Hello, World!", point) | |
} | |
input.appendListener { event -> | |
if (event.type === InputEventType.DRAG) { | |
point.assign(event.x, event.y) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment