Giter Site home page Giter Site logo

kode / kha Goto Github PK

View Code? Open in Web Editor NEW
1.5K 106.0 171.0 24.75 MB

Ultra-portable, high performance, open source multimedia framework.

Home Page: http://kha.tech

License: zlib License

Haxe 22.44% C++ 0.82% C 76.44% GLSL 0.02% JavaScript 0.08% Batchfile 0.01% Shell 0.03% Objective-C 0.03% CMake 0.13%

kha's Introduction

Kha

Kha is a low level sdk for building games and media applications in a portable way. Think SDL, but super-charged. Based on the Haxe programming language and the krafix shader-compiler it can cross-compile your code and optimize your assets for even the most obscure systems. Kha is so portable, it can in fact run on top of other game engines and its generational graphics and audio api design gets the best out of every target, supporting super fast 2D graphics just as well as high end 3D graphics. Also, Kha probably added a new target while you were reading this text.

Community

Features

  • Great performance on each platform.
  • Generational graphical/audio API design.
  • Hardware accelerated 2D and high-end 3D graphics. Fallback support (i.e. html5 canvas).
  • Can run on top of other game engines (i.e. Unity3D).
  • Write shaders in GLSL and cross-compile to target specific shaders.
  • Kha apps can also be compiled to C# or Java libraries
  • Flexible and robust backend system. Adding your own takes little effort and is straight forward.
  • One API for all platforms!

Supported platforms

  • HTML5 (WebGL 2, WebGL and canvas or running in a WebWorker)
  • Windows (Direct3D 12, Direct3D 11, Direct3D 9, Vulkan or OpenGL)
  • Linux (Vulkan or OpenGL)
  • macOS (Metal or OpenGL)
  • FreeBSD
  • Android (Vulkan or OpenGL)
  • iOS (Metal or OpenGL)
  • tvOS
  • Raspberry Pi
  • Universal Windows Platform
  • Node.js (for automatically created server versions)
  • Java and AWT
  • C# and Windows Presentation Foundation
  • PlayStation 4*
  • PlayStation 5*
  • Xbox One*
  • Xbox Series X|S*
  • Nintendo Switch*

* The consoles code is not public. If you are a registered developer with Microsoft/Nintendo/Sony you can contact us to get access.

kha's People

Contributors

andreirudenko avatar aoe-maniac avatar caiopsouza avatar catcuddler avatar chipshort avatar disar avatar gluks avatar huyston avatar jarrio avatar jefvel avatar joncom avatar juakob avatar laxa88 avatar luboslenco avatar marianthull avatar matrefeytontias avatar moritzbrueckner avatar nadako avatar posxposy avatar rafaeloliveira avatar ratalaika avatar rblsb avatar robdangerous avatar sanva avatar sh-dave avatar spookyfm avatar vujadin avatar wighawag avatar williamthompsonj avatar zshoals avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kha's Issues

Update Hake version

The current version of hake is outdated, it took me a long time to figure out why specifying additional sources in project.kha was not working.

By the way, I added documentation for that feature to the wiki with a note that it requires a newer version of hake, be sure to remove that.

screen stretched and runtime error on resize in flash target after last commit(s)

the last commits seem to have caused an issue on the flash target.. when screen is now stretched down horizontally and when I resize the flash player window the following runtime error is thrown:

[Fault] exception, information=Error: Error #3700: A texture sampler binds an incomplete texture. Make sure to upload(). All miplevels are required when mipmapping is enabled.

This was not happening before..

Can't render Tilemap with negative x/y

I have a tilemap like this:

tilemap = new Tilemap("tiles", 32, 32,
    [   [ 1, 1, 0, 1, 1, 0 ],
        [ 1, 0, 0, 0, 1, 0 ],
        [ 1, 0, 0, 0, 1, 0 ],
        [ 1, 1, 1, 1, 1, 0 ],
        [ 0, 0, 0, 0, 0, 0 ]
    ], null, true);

When I render it like this

tilemap.render(painter, Std.int(x), Std.int(y), 800, 600);

I get an error as soon as x and y become negative. As I set the tilemap with repeat = true, this doesn't make much sense in my opinion.

Outdated / not working XNA and WPF backends

I tried to export my little test to XNA and WPF, but none of them worked.
It seems like WPF-backend was not updated since the scaling was introduced and therefore, two properties are missing:

Kha/Sources/kha/Game.hx:62: characters 23-37 : kha.#Sys has no field pixelWidth
Kha/Sources/kha/Game.hx:62: characters 40-55 : kha.#Sys has no field pixelHeight
(this repeats several times for other line numbers)

For XNA, I get the following error:

Kha/Sources/kha/Loader.hx:8: characters 1-30 : Class not found : Blob

PS: I added the properties in WPF manually, but when I try to run it, I get another error.

Unknown exception : System.IO.FileNotFoundException: Die Datei "C:\Users\Christoph\Documents\Programmierung\kha\Ploing\build\wpf-build\bin\Debug\kha.loader.Asset" konnte nicht gefunden werden.

Dateiname: 'C:\Users\Christoph\Documents\Programmierung\kha\Ploing\build\wpf-build\bin\Debug\kha.loader.Asset'
   bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   bei System.IO.File.InternalReadAllBytes(String path, Boolean checkHost)
   bei System.IO.File.ReadAllBytes(String path)
   bei kha.wpf.Loader.loadBlob(Object __temp_filename108, Function done) in c:\Users\Christoph\Documents\Programmierung\kha\Ploing\build\wpf-build\Sources\src\kha\wpf\kha\backends\wpf\kha\wpf\Loader.hx:Zeile 51.
   bei kha.Loader.loadFiles(Function call, Boolean autoCleanup) in c:\Users\Christoph\Documents\Programmierung\kha\Ploing\build\wpf-build\Sources\src\kha\kha\sources\kha\Loader.hx:Zeile 224.
   bei kha.wpf.Loader.loadProject(Function call) in c:\Users\Christoph\Documents\Programmierung\kha\Ploing\build\wpf-build\Sources\src\kha\wpf\kha\backends\wpf\kha\wpf\Loader.hx:Zeile 31.
   bei kha.Starter.start(Game game) in c:\Users\Christoph\Documents\Programmierung\kha\Ploing\build\wpf-build\Sources\src\kha\kha\backends\wpf\kha\Starter.hx:Zeile 263.

Unable to get started with the geting started examples

Hi Rob,

I'm trying to follow the getting started at https://github.com/KTXSoftware/Kha/wiki/Getting%20Started but run into some issues. This is the log from running git clone --recursive https://github.com/KTXSoftware/Ploing > log.txt 2>&1:

Cloning into 'Ploing'...
Submodule 'Kha' (https://github.com/KTXSoftware/Kha) registered for path 'Kha'
Cloning into 'Kha'...
Submodule path 'Kha': checked out '6a4ca27f0eb546029b7f5c0b16b79c558a96e59b'
Submodule 'Backends/kxcpp' (https://github.com/KTXSoftware/kxcpp) registered for path 'Backends/kxcpp'
Submodule 'Kore' (https://github.com/KTXSoftware/Kore) registered for path 'Kore'
Submodule 'KoreVideo' (https://github.com/KTXSoftware/KoreVideo) registered for path 'KoreVideo'
Submodule 'Tools/hake' (https://github.com/KTXSoftware/hake) registered for path 'Tools/hake'
Submodule 'Tools/haxe' (https://github.com/KTXSoftware/haxe) registered for path 'Tools/haxe'
Submodule 'Tools/khamake' (https://github.com/KTXSoftware/khamake) registered for path 'Tools/khamake'
Cloning into 'Backends/kxcpp'...
Submodule path 'Backends/kxcpp': checked out '392b6734d82906d2c45d2986b7169d4fbd8180b5'
Cloning into 'Kore'...
Submodule path 'Kore': checked out '39fc686bfc2ca6d5376911658bc9e09456c52945'
Submodule 'Tools/kake' (https://github.com/KTXSoftware/kake) registered for path 'Tools/kake'
Submodule 'Tools/kfx' (https://github.com/KTXSoftware/kfx) registered for path 'Tools/kfx'
Submodule 'Tools/koremake' (https://github.com/KTXSoftware/koremake) registered for path 'Tools/koremake'
Submodule 'Tools/kraffiti' (https://github.com/KTXSoftware/kraffiti) registered for path 'Tools/kraffiti'
Cloning into 'Tools/kake'...
Submodule path 'Tools/kake': checked out 'baee9df45885fd73ff7797a266c849060ba5a39d'
Submodule 'kmdlib' (https://github.com/KTXSoftware/kmdlib) registered for path 'kmdlib'
Cloning into 'kmdlib'...
Submodule path 'kmdlib': checked out 'd3b8ce6ab72acf710f0852c5aadafa6217c5b821'
Cloning into 'Tools/kfx'...
Submodule path 'Tools/kfx': checked out '6233657ae5c069898167dcfcabb53e263091ed06'
Submodule 'angleproject' (https://github.com/KTXSoftware/angleproject) registered for path 'angleproject'
Submodule 'glsl2agal' (https://github.com/KTXSoftware/glsl2agal) registered for path 'glsl2agal'
Cloning into 'angleproject'...
Submodule path 'angleproject': checked out 'f0964d84f9c0a68b77ffa391b7ae4c5c3e59a913'
Cloning into 'glsl2agal'...
Submodule path 'glsl2agal': checked out '5b1811de83653ed3befe65b6034b275c897b473c'
Cloning into 'Tools/koremake'...
Submodule path 'Tools/koremake': checked out '25021d02cec17065913e3456324ea3afc05ada4e'
Cloning into 'Tools/kraffiti'...
fatal: reference is not a tree: 0db1b021c05a420aa226a8bf3ef482673de4768c
Unable to checkout '0db1b021c05a420aa226a8bf3ef482673de4768c' in submodule path 'Tools/kraffiti'
Cloning into 'KoreVideo'...
Submodule path 'KoreVideo': checked out 'b2b02ee1b68471c35ae1a01b73fa7d0e893103ac'
Submodule 'ogg' (https://github.com/KTXSoftware/ogg) registered for path 'ogg'
Submodule 'theora' (https://github.com/KTXSoftware/theora) registered for path 'theora'
Submodule 'vorbis' (https://github.com/KTXSoftware/vorbis) registered for path 'vorbis'
Cloning into 'ogg'...
Submodule path 'ogg': checked out 'ab78196fd59ad7a329a2b19d2bcec5d840a9a21f'
Cloning into 'theora'...
Submodule path 'theora': checked out 'b3c2575bad18002ddab427b1c8916a0824fb76e8'
Cloning into 'vorbis'...
Submodule path 'vorbis': checked out '39309f9601058f2498f1e587945ececd6652a5ec'
Cloning into 'Tools/hake'...
Submodule path 'Tools/hake': checked out 'd2c086f61029fdf81cf820005cced35f1af5bc73'
Submodule 'kmdlib' (https://github.com/KTXSoftware/kmdlib) registered for path 'kmdlib'
Cloning into 'kmdlib'...
Submodule path 'kmdlib': checked out 'd3b8ce6ab72acf710f0852c5aadafa6217c5b821'
Cloning into 'Tools/haxe'...
fatal: reference is not a tree: 354d24389c375edd3bc973edc64a582c150653be
Cloning into 'Tools/khamake'...
Submodule path 'Tools/khamake': checked out '46d123561ef2fc6ccfec7339a259d783cd637e28'
Failed to recurse into submodule path 'Kore'
Unable to checkout '354d24389c375edd3bc973edc64a582c150653be' in submodule path 'Tools/haxe'
Failed to recurse into submodule path 'Kha'

Afterwards Kha/Tools/haxe is empty and Kha/make.js doesn't exist.

Same behavior with the other samples. The only one that kind of works is BlocksFromHeaven, but there I get an asset exception at run-time. That's probably due to the mp3 issue mentioned on the wiki page though.

Error on android

I'm trying to execute the Empty example on android, but is crashing with this error in logcat:

06-08 18:36:42.725: W/dalvikvm(24895): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/ktxsoftware/kore/KoreLib;
06-08 18:36:42.725: W/dalvikvm(24895): threadid=11: thread exiting with uncaught exception (group=0x4169cd40)
06-08 18:36:42.727: E/AndroidRuntime(24895): FATAL EXCEPTION: GLThread 78018
06-08 18:36:42.727: E/AndroidRuntime(24895): Process: com.ktxsoftware.kore, PID: 24895
06-08 18:36:42.727: E/AndroidRuntime(24895): java.lang.UnsatisfiedLinkError: Couldn't load Kore from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.ktxsoftware.kore-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.ktxsoftware.kore-2, /vendor/lib, /system/lib]]]: findLibrary returned null
06-08 18:36:42.727: E/AndroidRuntime(24895):    at java.lang.Runtime.loadLibrary(Runtime.java:358)
06-08 18:36:42.727: E/AndroidRuntime(24895):    at java.lang.System.loadLibrary(System.java:526)
06-08 18:36:42.727: E/AndroidRuntime(24895):    at com.ktxsoftware.kore.KoreLib.<clinit>(KoreLib.java:7)
06-08 18:36:42.727: E/AndroidRuntime(24895):    at com.ktxsoftware.kore.KoreActivity$1.run(KoreActivity.java:140)
06-08 18:36:42.727: E/AndroidRuntime(24895):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1463)
06-08 18:36:42.727: E/AndroidRuntime(24895):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

I'm new to Kha, and new to the use of submodules in git, I found this command to update all the submodules:
git submodule foreach --recursive git pull origin master
all the submodules were pulled

Cannot compile TPlayer on linux 64bit for flash/html5 or linux

Hey,

I am trying to compile the TPlayer project for flash html5 or linux. I am on a 64Bit linux system. For flash, I get:

./Kha/Tools/hake/hake-linux flash                                  master/.
Generating Kha project.
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
File exists
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unknown aggregate
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unknown aggregate
File exists
File exists
Done.

html5 compiles fine, but when I open index.html, chromium tells me:

Failed to load resource: net::ERR_FILE_NOT_FOUND file:///home/ls/src/TPlayer/build/html5/JSProject.js

For the linux target, when I try to compile it in codeblocks, I get a lot of errors. See this gist: https://gist.github.com/RudolfVonKrugstein/9726894

The first error is in Scriptable.h, where at this line:

struct ScriptNamedFunction : public ScriptFunction

where the class "ScriptFunction" is not known.

Class not found : haxe.io.Float32Array

Hi

I cloned the Empty project

git clone --recursive https://github.com/KTXSoftware/Empty.git

executed khamake for html5

node Kha/make -t html5

and while when I execute the khamake server

node Kha/make --server

I can see the project running fine (black canvas)

if I want to use the generated hxml

haxe project-html5.hxml

I get the following error:

..\Kha\Backends\HTML5/kha/graphics4/VertexBuffer.hx:3: characters 7-27 : Class not found : haxe.io.Float32Array

Any ideas?

Can't build any examples on Windows 8

When I try to build “Empty" project or any other example project, after executing node Kha/make flash, I got following errors:

C:\tmp\Empty>node Kha\make flash
Graphics: direct3d9
Vr API is: none
Generating Kha project.
Assets done.
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-colored.frag.glsl
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-colored.vert.glsl
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-image.frag.glsl
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-image.vert.glsl
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-text.frag.glsl
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-text.vert.glsl
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-video.frag.glsl
Shader compiler process exited with code 3221225781 while trying to compile Kha
Sources\Shaders\painter-video.vert.glsl
Done.

Kah's haxe produces error

I build my project via "Kha\Tools\hake\hake flash" and open the generated project-flash.hxproj in FlashDevelop. When I try to compile it, get the following output:

Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe "D:\Development\_Projekte\Haxe\Snakhe\build\project-flash.hxproj" -ipc 73dfe176-2fd7-41fd-b5c4-c1cacf533ceb -version "3.0.1" -compiler "D:\Development\_Projekte\Haxe\Snakhe\build\../Kha/Tools/haxe" -library "C:\Program Files (x86)\FlashDevelop\Library"
Building project-flash
haxe  -debug -D fdb --each -cp ../Sources -cp ../Kha/Sources -cp ../Kha/Backends/Flash -swf D:/Development/_Projekte/Haxe/Snakhe/build/flash/kha.swf -swf-header 640:480:60:FFFFFF -swf-version 11.2 -main Main
Build halted with errors (haxe.exe).
Done(1)

Only when I remove the "../Kha/Tools/haxe" in "Project -> Properties... -> SDK -> Custom SDK" and thus using the 'official' haxe, I'm able to compile the project. What could be the problem? I closely followed the instructions from here to get Kha running: https://github.com/KTXSoftware/Kha/wiki/Getting-Started
PS: The same is true for the HTML5 target.

iOS project failed to open

PS : It took me sometime to figure out how to build which is

$ node Kha/make ios

And got

Vr API is: none
Generating Kha project.
Exporting asset 1 of 19 (bg2.png).
Exporting asset 2 of 19 (t_b80x80x86.png).
Exporting asset 3 of 19 (World9.png).
Exporting asset 4 of 19 (enemy_fliege_b2x44x28.png).
Exporting asset 5 of 19 (enemy_walker_b12x48x42.png).
Exporting asset 6 of 19 (explo_normal_b5x58x54.png).
Exporting asset 7 of 19 (tshot_kugel_klein_b2x16x16.png).
Exporting asset 8 of 19 (tshot_kugel_normal_b1x32x32.png).
Exporting asset 9 of 19 (explo_klein_b4x28x28.png).
Exporting asset 10 of 19 (explo_abschussl_b1x30x30.png).
Exporting asset 11 of 19 (explo_abschussr_b1x30x30.png).
Exporting asset 12 of 19 (explo_normal).
Exporting asset 13 of 19 (enemy_platt).
Exporting asset 14 of 19 (T_fall_landing).
Exporting asset 15 of 19 (T_shot_kugel_normal).
Exporting asset 16 of 19 (T_shot_kugel_klein).
Exporting asset 17 of 19 (L_cave).
Exporting asset 18 of 19 (Level2.lv6).
Exporting asset 19 of 19 (World9.bl6).
Assets done.
VrApi (main.js): undefined
korefile found, generating build files.
Generating iOS solution
.
.
.
.done.
Done.
kraffiti stdout: #58x58
kraffiti stdout: #80x80
kraffiti stdout: #87x87
kraffiti stdout: #120x120
kraffiti stdout: #120x120
kraffiti stdout: #29x29
kraffiti stdout: #40x40
kraffiti stdout: #58x58
kraffiti stdout: #76x76
kraffiti stdout: #80x80
kraffiti stdout: #152x152
kraffiti stdout: #180x180

Everything generated fine but when i try to open T Player.xcodeproj i got

TPlayer/build/ios-build/T Player.xcodeproj cannot be opened 
because the project file cannot be parsed.

Any hint?

[hake] Linux x86_64

Sorry if this is a wrong place to ask, i just didn't find more suitable place :)

I'm trying to run hake-linux in Ubuntu 14.04 64.
Here is what i get:

Empty$ ./Kha/Tools/hake/hake-linux
Generating Kha project.
File exists
File exists
File exists
File exists
File exists



//empty lines also exist in hake output




File exists
File exists
Kha/Kore/Tools/kake/kake-linux: error while loading shared libraries: libboost_regex.so.1.53.0: cannot open shared object file: No such file or directory
Done.

after creating a symlink for libboost_regex.so.1.53.0 -> libbost_regex.so (btw i have libboost_regex 1.54)
i get this:

$ ./Kha/Tools/hake/hake-linux
Generating Kha project.
File exists
File exists
File exists
File exists
File exists








File exists
File exists
Kha/Kore/Tools/kake/kake-linux: error while loading shared libraries: libboost_regex.so.1.53.0: wrong ELF class: ELFCLASS64

So i guess hake-linux is built for i386. Is there a way i can rebuild it for my architecture?

Zip problems with C++ targets

When I'm loading zip files it works fine on anything but C++ targets. The program will crash with an error about neko related stuff.

The current fix :

Delete the zip folder in Kha\Tools\haxe\std\cpp\_std\haxe

hake misses libboost_regex.so.1.53.0 on linux mint 17

Hey,

On linux mint 17 running hake I get:

Kha/Kore/Tools/kake/kake-linux: error while loading shared libraries: libboost_regex.so.1.53.0: cannot open shared object file: No such file or directory

But the lowest libboost package is 1.54.0. Maybe I should recompile kake? Are there instructions for that?

Gfx glitches with tilemaps and animated sprites on iOS

When the configured app resolution is different to the native resolution of the system, everything is scaled accordingly - this results in little glitches with tightly packed texture atlases (like tilemaps) due to texture filtering.

-> Render to texture in correct resolution, then scale that.

obtaining a perfectly smooth object movement

Hello,

as developing slot machine games with kha. I have a very simple implementation of spinning reels based on drawImage2. It looks good, and the vertical movement of the spinning reels seems smooth, however I'm seeing some small stepping in the vertical movement of the reels. These stepping kind of breaks the smoothness of the spinning animation and seem to appear regularly in time.

I can see the stepping in both the windows and flash targets.

I'm wondering if I'm doing things right, basically I'm simply measuring the time gap between frames and then I'm using this to increment the y-coordinate that corresponds to the reel position. Is this the right way to do it?

I have uploaded the small project here, it is very few lines of code.. It would be good if you could take a quick look at it and tell me what you thing.

http://www.slot-ide.com/web/data/spinningreels.zip

Thanks

GUI Example

Is there some example on which one could learn how to use the gui system?

video support

Hello,

I'm trying to embed a video in my kha application, I have added the video asset to the project.kha but the video does not seem to be considered (it does not end up being in the build directory that gets generated together with the other assets).

Also, in Video.hx I don't see anything to position and size the video, are videos currently displayed in overlay at a fixed position and original size?

isOpaque() implementation

Hello, I would like to detect mouse clicks on images
and sprites that appear on the screen. I was thinking to rely on the isOpaque()
method of the Image/Texture class, however is see that
this is not implemented for the flash target, and for the windows target
the body of the method is commented out.

Is it something you are going to complete in the near future??
Would you suggest a different way to detect which object is hit by
a mouse click??

adding android extensions

Hey,

Is there some documented way of how to make an android extension for kha? I would like to use mobilecore in a kha game ...

clipping/masking support

Hello,

I would like to know if you are going to add support for clipping/masking sprites in order to display only a specific area. Or it is possible to implement something similar to glScissor..

Or is this meant to be done through painter.drawImage2 by using the right arguments?

Image and drawRect not rendering all the pixels

I am trying to draw a rectangle in an image of the same width. Here is the code :

this.texture = Image.createRenderTarget(this.width, this.height);
    override public function refresh()
    {
        var g : Graphics = this.texture.g2;
        g.begin();

        g.clear(Color.fromValue(0x00000000));

        g.color = this.color;
        // TODO : (0) Remove the hack to draw from (0,0) when Robert fix the bug
        g.drawRect(0, 0, this.get_width(), this.get_height());

        g.end();
    }

Here is the result :
imagerect1

I tried with this code too :

    override public function refresh()
    {
        var g : Graphics = this.texture.g2;
        g.begin();

        g.clear(Color.fromValue(0x00000000));

        g.color = this.color;
        // TODO : (0) Remove the hack to draw from (0,0) when Robert fix the bug
        g.drawRect(1, 1, this.get_width(), this.get_height());

        g.end();
    }

Here is the result :
imagerect2

In both sample, there a pixel missing in the image rendered.

I have testing it on html5 target.

Faster way to install Kha

Cloning the repo 'Empty' has the disadvantages that it is often outdated and needs much time and space.

I suggest adding these instructions to Kha's wiki or description:

How to start a new project with Kha:

  1. Create an empty folder and open a terminal in it
  2. Execute these commands:
git init
git submodule add --depth=1 "https://github.com/KTXSoftware/Kha.git" "Kha"
git submodule update --depth=1 --init --recursive

How to update Kha:

  1. Execute this command in your project folder
git submodule update --depth=1 --recursive

[Java] setColor alpha

The setColor function of Painter in the Java backend currently ignores alpha values.

Kha does not define kha

I am writing a library and I need to do some conditional compilation whether kha is used or not.
Could kha define #kha so I can do

#if kha
...
#end

thanks

Kha Build Tools Request

Hello Robert,

I am currently making a framework/game engine built upon Kha. In this I would like projects to be structured as such:

Project Folder
  SomeProjectDefinition.yml
  / assets
    art.jpg
  / src
    Code.hx
    AnotherFile.hx

I am planning on auto-generating project.kha, the problem is that hake doesn't swallow a structure like this. It expects project.kha to be in a folder that contains a Kha folder with all the tools in it.
Now this isn't a big problem for a single project, but if someone were to have to have X projects it would need X copies of Kha and tools. I believe it is not possible at the moment to have this externalised (I may be wrong?).

I read in the G+ group that you are working on khamake (which is a node.js alternative to hake if I am right?). I would like to request the enhancement to use the Kha buildtools from anywhere (this is probably also "required" if you are aiming for haxelib integration).

fullscreen and second display support

Hello,

I had a look at the code and support for fullscreen does not seem to be there. Is it something you are going to add/implement?

Also, it would be good to be able to start the application on a specific display when the PC is connected to multiple displays (Win, Linux and Mac).

Class not found : kha.loader.Asset

target windows or android
Kha/Backends/Kore/kha/cpp/Loader.hx:6: characters 7-23 : Class not found : kha.loader.Asset
Kha/Backends/Kore/kha/Starter.hx:7: lines 7-130 : Defined in this class

Doesn't work properly on some android devices

Hello.

It seems like this framework doesn't work on android devices with gpus that don't support integer, which seem pretty common among gpus on Samsung Galaxy devices.

I've tried to run Velvet Worm and Blocks From Heaven on Samsung Galaxy Note II which uses mali 400 mp gpu and both of them only show blank screen.
After changing GL_UNSIGNED_INT as an argument in glDrawElements in Graphics::drawIndexedVertices to GL_UNSINGED_SHORT, now I can see something white moving in the Velvet Worm demo, although it still doesn't look like it does on flash and windows target.
Maybe I have to change other integer involving openGL stuff or there's other issues.

Loader unclarity

A few notes after an evening of messing about with the Loader, without success:

  1. Assets must be in a folder named Assets/AssetType+s, so Assets/Graphics for images. I couldn't find this documented and only found out by staring at the source code/examples. I can add it to the wiki, but is this actually the case? It didn't work for me if I didn't place it there,
  2. Maybe nice to non-hardcode point 1 if it is the case.
  3. I was unable to get loading to work, room seems to be null whichever name I specify.
Loader.the.loadRoom("level", init);

4.Loading an asset directly is unclear.

Loader.the.loadImage("lambda", null);

[Fault] exception, information=ReferenceError: Error #1069: Property file not found on String and there is no default value.

Whoops, it needs an anonymous object with a file property, maybe this can be documented.


Link to project.kha file I was working with.

Maybe I am just not seeing it, I can't seem to figure out room loading. Any pointers?

[Android] crashing bugs

When starting the game on Android, stopping it immediately and starting it again from task manager, it crashes or shows a blackscreen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.