deno-windowing / dwm

Deno Window Manager: Cross-platform window creation and management
https://deno.land/x/dwm
Apache License 2.0
138 stars 10 forks source link

MouseMove #2

Closed nhrones closed 1 year ago

nhrones commented 1 year ago

Is there a way to get mouse events in a canvasWindow? (the cube example)? I've tried addEventListener on the win.window object and the win.canvas object in the cube example with no luck. What am I missing?

Also, resizing the canvas seems to have no effect? A clearRect() or fillRect() always paints the whole window, not just the canvas area? Although other paths rendered are actually clipped to the new canvas size>

nhrones commented 1 year ago

I found what I needed! The loop and wait options of the mainLoop call, unblock events. I also researched sk-canvas and sk-surface, and I better understand the relationship of the window and canvas now. Thanks again! Keep up the good work.

DjDeveloperr commented 1 year ago

Btw you need to use global addEventListener function instead of on window or canvas.

nhrones commented 1 year ago

Yes! discovered that. Thanks!