stroke_text :: (text: str, x: f32, y: f32, max_width := -1.0f) -> void #foreign "canvas" "stroke_text" ---
transform :: (a: f32, b: f32, c: f32, d: f32, e: f32, f: f32) -> void #foreign "canvas" "transform" ---
translate :: (x: f32, y: f32) -> void #foreign "canvas" "translate" ---
+
+// Mouse interaction
+// This one does not wait for a click, and live updates.
+// Use '.sync'
+mouse_position_internal :: (out_x: ^f32, out_y: ^f32) -> void #foreign "canvas" "mouse_position" ---
+mouse_position :: () -> (f32, f32) {
+ mx, my: f32;
+ mouse_position_internal(^mx, ^my);
+ return mx, my;
+}
+
+// This one waits for a click event to happen, and returns the position
+// on the canvas where the click occurs.
+mouse_click_internal :: (out_x, out_y: ^f32) -> void #foreign "canvas" "mouse_get_click" ---
+mouse_click :: () -> (f32, f32) {
+ mx, my: f32;
+ mouse_click_internal(^mx, ^my);
+ return mx, my;
+}