This commit is contained in:
2026-05-06 17:52:45 -07:00
parent 9fc3f35125
commit 1463c23334
402 changed files with 3758 additions and 0 deletions

1
file_write/README.md Normal file
View File

@ -0,0 +1 @@
https://github.com/leenkx3d/leenkx/wiki/reference#write-json

View File

@ -0,0 +1,28 @@
package lnx;
class WriteFile extends iron.Trait {
public function new() {
super();
notifyOnInit(function() {
// File writing in Krom
// To save data in HTML5, see file_storage example
#if kha_krom
// Data to save
var o = { test: "Hello" };
var s = haxe.Json.stringify(o);
// Save file into game build folder
// Playing from Blender the file will be saved at
// file_write/build_file/debug/krom/my_file.json
var path = Krom.getFilesLocation() + "/my_file.json";
// Write file
var bytes = haxe.io.Bytes.ofString(s);
Krom.fileSaveBytes(path, bytes.getData());
#end
});
}
}

BIN
file_write/file_write.blend Normal file

Binary file not shown.