hammerspoon2-docs
    Preparing search index...

    Function create

    • Create a new canvas

      Named create() rather than v1's new() -- new cannot be used as a JavaScriptCore-exported method name (it collides with the JS new operator keyword at the bridging layer), and this codebase's conventions additionally forbid method names starting with new/alloc/copy (an ARC/ObjC hazard).

      Parameters

      • rect: HSRect | { h: number; w: number; x: number; y: number }

        The canvas window's frame: an HSRect (e.g. a window's or screen's frame) or a {x, y, w, h} dictionary, with y = 0 at the top of the primary screen

      Returns HSCanvas

      A new HSCanvas, not yet shown