Recent Posts

Hello! Here is my template for VSCode (vshaxe) of empty openfl application with debugging for Html5 (Chrome) & Hxcpp https://github.com/r3d9u11/vscode-templates/tree/master/haxe/kha_application, may be it will be useful for someone.

posted in Kha read more

@wad1m https://github.com/Kode/Kha/wiki/Examples

"Navigate to the directory and execute node Kha/make flash. This will create a FlashDevelop project file in a build subdirectory. You can load and build this project directly. "

I tried to do
"node Kha/make linux"
"node Kha/make flash"

Here is my "Empty/build":
flash flash-resources
linux
linux-build
linux-resources
project-flash.hxml
project-flash.hxproj
project-flash-intellij
project-linux.hxml
project-linux.hxproj
project-linux-intellij
temp

posted in Kha read more

posted in Kha read more

Hi. I collected a little samples for a beginner users of Kha. Git repo of collection.

In future will be add samples of polygons, 3D graphics and additional libraries for Kha.

posted in Kha read more

@Robert Thank you for the explanation!

posted in Kha read more

Idea of this sample is:

  • "frameTask" will increment counter (counter of total rendered frames) after all other frame tasks (priority 100)
  • "timeTask" every 1 second will show the value of this counter and restore it to 0

posted in Kha read more

Hi. What do you think, is it right way to count FPS? My sample:

package;

import kha.Color;
import kha.Assets;
import kha.System;
import kha.Scheduler;
import kha.Framebuffer;

class KhaApplication {
    public function new () {
        var fps = 0;
        var refreshFps = false;
    
        Scheduler.addFrameTask(function () fps++, 100);
        Scheduler.addTimeTask(function () refreshFps = true, 0, 1);

        Assets.loadEverything(function () System.notifyOnRender(function renderFps (fb:Framebuffer) {
            if (refreshFps) {
                fb.g2.begin();
                fb.g2.color = Color.Red;
                fb.g2.font = Assets.fonts.Arial;
                fb.g2.drawString(Std.string(fps), 10, 10);
                fb.g2.end();

                fps = 0;
                refreshFps = false;
            }
        }));
    }
}

When does the event "FrameTask" occur?
Does it occur after all renderers is completed?
What is the meaning of the parameter "priority" of the method Scheduler.addFrameTask?

Thanks.

posted in Kha read more

Hi. I need help with managing windows.

Is it possible to handle window's events?

  • on size changed (native)
  • on position changed (native)
  • on window maximized/minimized (native)
  • on window closed

And how to work with mouse cursor?

  • hide cursor
  • set a custom cursor

Also this discussion available on github: https://github.com/Kode/Kha/issues/552

Thanks.

posted in Kha read more

@Robert Thank you for your answer, I'll use Kha directly from git.

posted in Kha read more

Hi. Is it possible to install Kha with actual version via haxelib (as described here)? (now haxelib repository contains v16.1.2 and git-repo https://github.com/KTXSoftware/Kha-haxelib at last time was updated an year ago)

Thanks.

posted in Kha read more