You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
[HTML5] Implement mouse/touch/key events in JS library.
This makes us more independent from emscripten libraries, giving us more control on the application lifecycle.
This commit is contained in:
@@ -710,15 +710,6 @@ const GodotDisplay = {
|
||||
GodotRuntime.setHeapValue(p_height, GodotConfig.canvas.height, 'i32');
|
||||
},
|
||||
|
||||
godot_js_display_compute_position: function (x, y, r_x, r_y) {
|
||||
const canvas = GodotConfig.canvas;
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
const rw = canvas.width / rect.width;
|
||||
const rh = canvas.height / rect.height;
|
||||
GodotRuntime.setHeapValue(r_x, (x - rect.x) * rw, 'i32');
|
||||
GodotRuntime.setHeapValue(r_y, (y - rect.y) * rh, 'i32');
|
||||
},
|
||||
|
||||
godot_js_display_has_webgl__sig: 'ii',
|
||||
godot_js_display_has_webgl: function (p_version) {
|
||||
if (p_version !== 1 && p_version !== 2) {
|
||||
|
||||
Reference in New Issue
Block a user