Skip to main content
Module

x/dwm/mod.ts>DwmWindow#setCustomCursor

Deno Window Manager: Cross-platform window creation and management
Go to Latest
method DwmWindow.prototype.setCustomCursor
Re-export
import { DwmWindow } from "https://deno.land/x/dwm@0.3.4/mod.ts";

Sets the cursor to a custom image

const cursor = new Uint8Array(16 * 16 * 4);
for (let i = 0; i < 16; i++) {
  cursor[i * 16 * 4 + i * 4 + 3] = 255;
  cursor[i * 16 * 4 + (15 - i) * 4 + 3] = 255;
}

win.setCustomCursor(cursor, {
  width: 16,
  height: 16,
}, {
  x: 0,
  y: 0,
});

Parameters

image: Uint8Array
hotspot: Size
position: Position