diff options
Diffstat (limited to '2026/examples')
| -rw-r--r-- | 2026/examples/godot/project/export_presets.cfg | 2 | ||||
| -rw-r--r-- | 2026/examples/godot/project/main.gd | 12 | ||||
| -rw-r--r-- | 2026/examples/js/index.html | 39 | ||||
| -rwxr-xr-x | 2026/examples/raylib/build.sh | 2 | ||||
| -rw-r--r-- | 2026/examples/raylib/main.c | 2 |
5 files changed, 48 insertions, 9 deletions
diff --git a/2026/examples/godot/project/export_presets.cfg b/2026/examples/godot/project/export_presets.cfg index 9d45cd8..5633989 100644 --- a/2026/examples/godot/project/export_presets.cfg +++ b/2026/examples/godot/project/export_presets.cfg @@ -8,7 +8,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../output/game.html" +export_path="../output/index.html" patches=PackedStringArray() patch_delta_encoding=false patch_delta_compression_level_zstd=19 diff --git a/2026/examples/godot/project/main.gd b/2026/examples/godot/project/main.gd index 051ee04..268afbc 100644 --- a/2026/examples/godot/project/main.gd +++ b/2026/examples/godot/project/main.gd @@ -2,15 +2,15 @@ extends Node # Called when the node enters the scene tree for the first time. func _ready() -> void: - JavaScriptBridge.eval("window.parent.postMessage({op: \"ready\"});") + JavaScriptBridge.eval("window.parent.postMessage({op: \"ready\"});") var started = false # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: - if !started && JavaScriptBridge.eval("window.lcolonqJamStart || -1.0") > 0.0: - started = true - JavaScriptBridge.eval("window.parent.postMessage({op: \"started\"});") + if !started && JavaScriptBridge.eval("window.lcolonqJamStart || -1.0") > 0.0: + started = true + JavaScriptBridge.eval("window.parent.postMessage({op: \"started\"});") func _input(event) -> void: - if event is InputEventMouseButton: - JavaScriptBridge.eval("window.parent.postMessage({op: \"done\", win: true});") + if event is InputEventMouseButton: + JavaScriptBridge.eval("window.parent.postMessage({op: \"done\", win: true});") diff --git a/2026/examples/js/index.html b/2026/examples/js/index.html new file mode 100644 index 0000000..f52c9c9 --- /dev/null +++ b/2026/examples/js/index.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> + <title>In Between The Iframes</title> + <style> + * { + margin: 0px; + padding: 0px; + } + body { + font-size: 70px; + } + #game-test { + width: 100%; + height: 100%; + } + </style> + <script type="module"> + console.log(window.innerWidth); + window.addEventListener("message", ev => { + switch (ev.data.op) { + case "start": + window.parent.postMessage({op: "started"}); + setTimeout(() => { + window.parent.postMessage({op: "done", win: true}); + }, 5000); + break; + default: console.log(`unknown event: ${ev}`); break; + } + }); + window.parent.postMessage({op: "ready"}); + </script> + </head> + <body> + hello from the js example + </body> +</html> diff --git a/2026/examples/raylib/build.sh b/2026/examples/raylib/build.sh index 6454acc..93411e4 100755 --- a/2026/examples/raylib/build.sh +++ b/2026/examples/raylib/build.sh @@ -1,4 +1,4 @@ #!/bin/sh set -xeu -o pipefail mkdir -p output -emcc -I./raylib/src libraylib.a -s USE_GLFW=3 -s ASYNCIFY --shell-file ./raylib/src/minshell.html main.c -DPLATFORM_WEB -o output/game.html +emcc -I./raylib/src libraylib.a -s USE_GLFW=3 -s ASYNCIFY --shell-file ./raylib/src/minshell.html main.c -DPLATFORM_WEB -o output/index.html diff --git a/2026/examples/raylib/main.c b/2026/examples/raylib/main.c index c047aa7..a070382 100644 --- a/2026/examples/raylib/main.c +++ b/2026/examples/raylib/main.c @@ -21,7 +21,7 @@ int main(int argc, char **argv) { if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { printf("clicked\n"); emscripten_run_script("window.parent.postMessage({op: \"done\", win: false});"); - return 0; + started = false; } BeginDrawing(); ClearBackground(RED); |
