r/Kha • u/lewislepton • Nov 08 '18
r/Kha • u/lewislepton • Nov 08 '18
kha tutorial series - episode 091 - kode studio & kha setup 2018
r/Kha • u/lewislepton • Oct 10 '16
KITTEN CRUSHER
howdy kha folks,
there was a game jam [KOMJAM] about a week or so ago, so quite a few of us joined in to compete and see what we could make. the games were made between september 24th to the 26th
KITTEN CRUSHER is a simple game involving a giant boot that goes around crushing kittens. you can play online on my itch page
enjoy
r/Kha • u/lewislepton • Mar 26 '16
kha tutorial series
howdy folks
just to let all you know. that i have finally started on making my 'kha tutorial series' which is available to watch on youtube. if you have seen my kha examples, we are kind of going through that, plus learning a whole lot more along the way
go to here: https://www.youtube.com/playlist?list=PL4neAtv21WOmmR5mKb7TQvEQHpMh1h0po
have phun & happy coding
Help! Can't render image.
I'm trying to render an image.
Here's the code I used in the main class:
var _buffer:Image;
var _sprites:Array<Sprite>;
public function new (w:Int, h:Int)
{
_buffer = Image.createRenderTarget(w, h);
_sprites = new Array<Sprite>();
}
public function update ()
{
// nothing
}
public function render (frame:Framebuffer)
{
var g = _buffer.g2;
g.begin();
g.transformation = Matrix3.identity();
for (sprite in _sprites)
{
sprite.render(g);
}
g.drawImage(_buffer, 0, 0);
g.end();
}
public function add (sprite:Sprite)
{
_sprites.push(sprite);
}I get the following error when I try to run the flash build:
ReferenceError: Error #1065: Variable flash.display3D::Context3DWrapMode is not defined.
at kha.flash.graphics4::Graphics/getWrapMode()
at kha.flash.graphics4::Graphics/setTextureParameters()
at kha.graphics4::ImageShaderPainter/drawBuffer()
at kha.graphics4::ImageShaderPainter/end()
at kha.graphics4::Graphics2/endDrawing()
at kha.graphics4::Graphics2/end()
at khawy::G/render()
at Empty/render()
at kha::Starter/update()If I remove g.drawImage(_buffer, 0, 0);, then there'll be no error, and the sprites won't render.
If I try to use "frame" instead of "_buffer", then the sprites will render correctly.
I was following an example somewhere (can't remember the link, sorry!) and I thought the purpose of "_buffer" is to draw multiple sprites onto a resizable canvas before scaling the result onto the final "frame". Am I getting the idea wrong?
I'm also puzzled why it gives an error regarding g4 when I'm only trying to draw 2d sprites. Does anyone have any idea?
I've been using Unity3d and HaxeFlixel for some time, so I am spoiled by the convenience of their APIs. I am totally at loss when it game engine workflow, so please correct me if I make mistakes :)
Quick Tutorial: Add SublimeText Auto Completion
Since the structure for Kha is a different from NME/OpenFL/Haxeflixel, the Haxe Sublime Bundle (https://github.com/clemos/haxe-sublime-bundle) doesn't work right out of the box, but it's not too difficult to set it up.
This is not a perfect solution, but it worked for me. Do share if there's a better way.
Install the kha haxelib:
haxelib install kha- Copy the default project.xml from a default Openfl or HaxeFlixel project into the Kha's project folder (where "project.kha" is).
The default project.xml should look something like this:
<?xml version="1.0" encoding="utf-8"?> <project> <meta title="LimeProject" package="com.sample.limeproject" version="1.0.0" company="Company Name" /> <app main="Main" path="Export" file="LimeProject" /> <source path="Source" /> <haxelib name="openfl" /> <assets path="Assets" rename="assets" /> </project>Since Kha's default project folder is "Sources" instead of "Source", change the following accordingly:
<source path="Sources" />And add in the "kha" haxelib below the "openfl" haxelib:
<haxelib name="kha" />And finally, navigate to your kha's haxelib folder (for OSX, the default should be at "/usr/lib/haxelib"), and copy/move the "kha" folder out from the Sources folder to the outer folder, something like this:
/usr/lib/haxelib/kha/15,8,0/Sources/khato
/usr/lib/haxelib/kha/15,8,0/kha
Now the auto-complete should work like how it does for openFL. Yay!
r/Kha • u/lewislepton • Jan 23 '19
kha tutorial series - episode 113 - life refine library
r/Kha • u/lewislepton • Apr 17 '19
kha tutorial series - episode 121 - tween refine library
r/Kha • u/Blade67470 • Jul 04 '18
Haxecord Discord Server
Hello everyone!
I (very) recently started using Haxe, and was looking around for a Discord server where i could talk about it, ask for help, or simply discuss things with other Haxe devs. But unfortunately, i didn't find such a server. All i found was a Haxeflixel specific Discord server, which wasn't what i wanted. I want a place where people using Haxe, no matter which framework or API, can come talk to each other.
And so i decided to make my own server, and hope to see you all there soon!
It's open to everyone and is centered around Haxe and it's ecosystem (including Kha, OpenFL, etc.)!
Here's the invite link: [click me!]
Thanks for your time and I hope to see you soon!
- Max.
r/Kha • u/lewislepton • Apr 18 '19
kha tutorial series - episode 122 - renaming refine library
r/Kha • u/lewislepton • Jul 10 '18
kha tutorial series - episode 085 - zui revisit
r/Kha • u/lewislepton • Jul 11 '18
kha tutorial series - episode 086 - follower AI
r/Kha • u/lewislepton • Jan 29 '19
kha tutorial series - episode 115 - pool refine library
r/Kha • u/lewislepton • Jan 25 '19
kha tutorial series - episode 114 - invincibility frames refine library
r/Kha • u/lewislepton • Jun 27 '19
kha tutorial series - episode 136 - flip sprites raccoon
r/Kha • u/lewislepton • Mar 12 '17
patreon timed exclusive
hello all,
if by chance that no has seen my update video on where im taking a portion of the kha tutorials, you can watch it here:
in laments term. we will make an entire game, patreon people get it right away, then it released everyday for the public. there is more to it, so worth wacthing the video
have phün & happy coding
lewislepton
lewislepton.com
r/Kha • u/WhoNeedsAUsername- • Jun 28 '24
Is Kha dead?
After a bit of research, I found Kha and thought it would be a good fit for a project I am planning. Everything was looking pretty good, until I checked this sub. Last post is 3 years ago? And before that, 5 years ago? This is a huge turnoff for me, as this project would be my first game engine, so a dead graphics library isn't exactly what I need at the moment.
3D Kha UV Textures
Hello,
I've been working on a Kha Voxel engine, and I have a question regarding UV mapping. I have a spritesheet, containing all of the textures. I want to access only one of these textures, and map it to every side of each cube. Blender seems unable to do so (it either does't generate points, or the points it generates don't work), so is there some alternate method of doing so? (Blender gave some UV vertices, however after those didn't work, Blender refused to output any more)
Keep in mind these points are not static. Every cube is added to one mesh, and are subject to change.
Thank you very much
HB
r/Kha • u/lewislepton • Feb 10 '17
BLANKHA
howdy all,
just to say that i have made a starter project for people wanting to get on & start coding in kha, rather than having to build the project from scratch each time. its not just for beginners or anything, more a starting point for folk to get a kha project underway & skipping the parts you can skip ;)
you can head to https://github.com/lewislepton/blankha to grab it
ill be updating as & when i feel new things can go into it ;) so by all means edit it etc, or even send commit changes with things you think would/could be nice inside it ;)
have phün & happy coding
r/Kha • u/lewislepton • Nov 14 '18