KryScene->Scene, KryNode->Node, KryonProperty*->Property*, KrySignal*->Signal*, KryTransform2D->Transform2D, and the KRY_NODE_/KRY_SCENE_/KRYON_PROPERTY_/KRY_SIGNAL_ enum and macro families to NODE_/SCENE_/PROPERTY_/SIGNAL_. Header guards keep their original names (internal). The lowercase kry_ module namespaces (kry_json, kry_term, ...) and the raymath-shadowing helpers (KryVector2*, KryClamp, KryLerp) stay prefixed: their unprefixed names collide with the raylib API surface kryon tracks.
32 lines
647 B
Plaintext
32 lines
647 B
Plaintext
#module "example_tilemap"
|
|
#import "kryon.h"
|
|
#import "kryon_example_font.h"
|
|
|
|
app "Kryon Tilemap" {
|
|
size 640 420
|
|
fps 60
|
|
font examples
|
|
theme THEME_SKY 0
|
|
scene main
|
|
}
|
|
|
|
#enum {
|
|
MAP_W = 10
|
|
MAP_H = 6
|
|
}
|
|
|
|
map_data :: [MAP_W * MAP_H] int #global #export
|
|
|
|
scene main {
|
|
i := 0
|
|
while i < MAP_W * MAP_H {
|
|
map_data[i] = ((i + i / MAP_W) % 3) + 1
|
|
i = i + 1
|
|
}
|
|
tiles := NodeCreate(scene, 0, NODE_TILEMAP, "tiles")
|
|
NodeSetPosition(scene, tiles, 64.0, 64.0)
|
|
props := KryTileMapPropsAlloc("tiles/tile.png", 32, 32, 4, MAP_W, MAP_H)
|
|
props->tiles = map_data
|
|
NodeSetProps(scene, tiles, props)
|
|
}
|