Skip to main content
Module

x/caviar/deps.ts>DwmWindow#setCustomCursor

⚡ Blazing fast, modern, Game Engine powered by WebGPU for Deno and the browser
Latest
method DwmWindow.prototype.setCustomCursor
Re-export
import { DwmWindow } from "https://deno.land/x/caviar@2.6.7/deps.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