A dot follows the mouse, two squares can be dragged with the left button, and a line at the bottom shows the cursor position and the number of left clicks.
It shows the mouse side of the input engine library:
followMouse2Dreadsctx.input.getMousePosition()(in game coordinates);drag2Dreadsctx.input.getDragState(): a drag that starts on aDraggable2Drectangle carries it until the button is released;showMouseReadoutcounts clicks withctx.input.isKeyPressed(InputEnum.MouseLeft).
pnpm install
pnpm dev # play it
pnpm editor # open it in the editorimage-fill.ts, the Position2D, DrawableRect2D, DrawableCircle2D and DrawableText2D
components and the draw2D system are copies of shared/2d (see the repository's README).