-
-
Notifications
You must be signed in to change notification settings - Fork 170
project.kha
This page is outdated. Kha now uses a javascript make file: khafile.js
Kha uses a JSON file called project.kha to organize the assets of your project and some essential project data. A basic project.kha looks like this:
{
"format": 3,
"game":
{
"name": "SML",
"width": 600,
"height": 520,
"antiAliasingSamples": 2
},
"assets":
[
{
"type": "image",
"file": "blockcoin.png",
"name": "blockcoin"
},
{
"type": "sound",
"file": "coin.wav",
"name": "coin"
},
{
"type": "music",
"file": "music1.wav",
"name": "music1"
},
{
"type": "blob",
"file": "level.map",
"name": "level.map"
},
{
"type": "font",
"file": "arial.ttf",
"size": 14,
"name": "Arial"
}
],
"rooms":
[
{
"name": "level1",
"parent": null,
"neighbours": [],
"assets":
[
"blockcoin",
"coin",
"music1",
"level.map",
"Arial14.kravur"
]
}
]
}
Kha supports five different types of assets:
For all kinds of images. You can provide images in jpeg, png, tga, bmp or gif format. All images are currently converted to png before actual use.
For small sound files in wav format. This is converted to different formats dependent on the target system.
For large sound files in wav format which will be streamed at runtime. This is converted to different formats dependent on the target system.
For video files. These are currently not converted automatically.
For binary blobs / everything else - provides a byte array at runtime.
Assets are organized in rooms. Typically a room corresponds to a level in a game. A room can have a parent room - when a room is loaded, all assets of that room are loaded as well as all assets of all parents. Applications typically use just one room.
##Additional Sources
Additional sources can be specified as such:
"sources":
[
"SomeLibraryFolder",
"AnotherLibrary/src"
]
- Introduction
- Getting Started
- Breaking Changes
- FAQ
- System targets
- Graphics targets
- Documentation
- API package descriptions