Atlas sample

This commit is contained in:
soywiz
2019-02-10 03:39:34 +01:00
parent 81705f7e3f
commit 89478b9326
7 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
apply plugin: "korge"
korge {
id = "com.soywiz.samples.bitmapfont"
}

View File

@@ -0,0 +1,11 @@
import com.soywiz.korge.*
import com.soywiz.korge.atlas.*
import com.soywiz.korge.view.*
import com.soywiz.korio.file.std.*
suspend fun main() = Korge(width = 640, height = 480, virtualWidth = 320, virtualHeight = 240) {
val logos = resourcesVfs["logos.atlas.json"].readAtlas(views)
image(logos["korau.png"].texture).position(0, 0)
image(logos["korim.png"].texture).position(64, 32)
image(logos["korge.png"].texture).position(128, 64)
}

View File

@@ -0,0 +1 @@
logos

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,3 +1,4 @@
include(":sample-atlas")
include(":sample-box2d")
include(":sample-scenes")
include(":sample-tic-tac-toe-swf")