Recent Posts

Ah I see that is what happens. Sorry, I didn't inspect the files closely enough.

If you're still interested, my build time is around 20 seconds for a blank kha project on a Lenovo g505 running Windows 8.1.

posted in Kha read more

Hey all,

I've noticed that Kode Studio will always compile all shaders and export all assets every time I build and run the project. For the sake of speeding up iteration time when testing code changes, is there a way to tell Kha to skip those steps and use whatever it last exported to the build/ folder?

Or perhaps having it check the modified time of those shader and asset files and only recompile them if they've been edited since the last compile?

If an option like this exists I'm guessing it's configurable through khafile.js. For future reference is there a place where all available options are listed out? The wiki has some examples but it doesn't show every possible option.

Thanks,
Devin

posted in Kha read more

Perfect, thanks! I should spend more time on the wiki :)

posted in Kha read more

I've been using Kode Studio for all my Kha development recently and I really like it! Currently I'm using the super nifty Ctrl + B shortcut to build Android projects. I can't seem to find a way to add compiler flags to those builds though. Particularly, I want to be able to write code like this:

#if touch
    import kha.input.Surface;
#else
    import kha.input.Mouse;
#end

And then use a compiler flag to set touch to true on compile. The Haxe Manual says I can do this with a compiler flag of -D touch.

I have 2 questions I suppose:

  1. Can we set Haxe compiler flags via Kode Studio?
  2. Is there a better way to get touch specific code into an Android build?

Sorry for all the questions recently but I figured it'd be good to have them recorded here for other noobs like me :)

posted in Kha read more

Ah excellent, that worked! That makes sense, thanks for your help. Also I wouldn't worry about KhaShmup, I'm afraid I didn't actually clone that one, just copy pasted the bits I thought I needed :( FONTnTEXT I did a proper clone of though.

posted in Kha read more

Fonts and I just don't seem to want to get along :( I've had an issue with fonts not working a while back but running that update submodules command didn't fix my problem this time.

Now whenever I try to set graphics.font = to something it errors on this line in Boot.hx:
else throw "Cannot cast " +Std.string(o) + " to " +Std.string(t);

And the debugger says o (my font) is null and t is function (blob) {}. Anybody run in to this or know how to fix it?

I've even tried cloning these projects that worked for me in the past, but now I get the same error as above.
https://github.com/jamiltron/KhaShmup/tree/part-8
https://github.com/lewislepton/kha-examples/tree/master/FONTnTEXT

I get this problem on Windows 7 and 8 compiling html5. I'm at a loss here, any help would be greatly appreciated. Thanks!

posted in Kha read more

Tire
VerletKha - A simple 2D Verlet physics engine
https://github.com/Devination/VerletKha

Just ported to Kha today. It's a lot of fun to fling these things around :p Try it out for yourself

posted in Kha read more

I'm a little late to the party but this is awesome, thanks! Makes it super easy to get a Kha project up and running. Debugging is much better than Flash Develop too. Great work!

posted in Kode Studio read more

Thanks for the replies. Turns out, quite a few of my files from Kha were out of date, the .bat file still works fine.

Lubos got me to run this command which fixed this issue
git submodule foreach --recursive git checkout master &&
git submodule foreach --recursive git pull origin master

Thanks Disar, I do want to do some videos on Kha once I get my bearings with it :)

posted in Kha read more

Hi all,

First-time poster here. I'm not sure if this is an issue with Kha or if I'm doing something wrong. Let me outline my steps:

  • I cloned the Empty project, created a 'Libraries' folder and cloned the zui library into it.
  • Following the instructions on the wiki, I included zui into my project.kha file
  • Following the lue_editor's project.kha as a template, I downloaded the font and included it in my project.kha
  • Without making any changes to any .hx files, I use the build.bat to build for html5

The command prompt outputs this:
Generating Kha project.
Exporting asset 1 of 2 (helvetica_neue.ttf).
Press any key to continue...

When I look in the build folder all I see are a 'temp' and 'html5' folder. Both empty. Any help would be greatly appreciated :)

This is what my project.kha file looks like:
{
"format": 2,
"game": {
"name": "Empty",
"width": 640,
"height": 480
},
"assets": [
{
"file": "helvetica_neue.ttf",
"name": "helvetica_neue",
"size": 18,
"type": "font"
},
{
"file": "helvetica_neue.ttf",
"name": "helvetica_neue",
"size": 16,
"type": "font"
}
],
"libraries": [
"zui"
],
"rooms": [
{
"assets": [
"helvetica_neue18.kravur",
"helvetica_neue16.kravur"
],
"name": "level1",
"parent": null,
"neighbours": []
}
]
}

posted in Kha read more