![]() Hs.faultTextStyle() -> hs.styledtext attributes table If you use Dock hiding (or in 10.11, Menubar hiding) please note that when the Dock (or Menubar) is popped up, it is done so with an implicit orderAbove, which will place it above any items you may also draw at the Dock (or MainMenu) level.Ī canvas object with a hs.canvas:draggingCallback function can only accept drag-and-drop items when its window level is at hs. or lower.Ī canvas object with a hs.canvas:mouseCallback function can only reliably receive mouse click events when its window level is at hs. + 1 or higher. For example, tests suggest that an active screen saver actually runs at a level of 2002, rather than at 1000, which is the window level corresponding to kCGScreenSaverWindowLevelKey.Įach window level is sorted separately and hs.canvas:orderAbove and hs.canvas:orderBelow only arrange windows within the same level. These key names map to the constants used in CoreGraphics to specify window levels and may not actually be used for what the name might suggest. Methods - API calls which can only be made on an object returned by a constructorĪPI Documentation Constants compositeTypes SignatureĪ table containing the possible compositing rules for elements within the canvas.Īrray of window behavior labels for determining how a canvas or drawing object is handled in Spaces and ExposéĪ table of predefined window levels usable with hs.canvas:level.Fields - Variables which can only be accessed from an object returned by a constructor.Constructors - API calls which return an object, typically one that offers API methods.Functions - API calls offered directly by the extension.Constants - Useful values which cannot be changed.Some examples of how to use this module can be found at Submodules When the module requires the value for an element's attribute it first checks the element definition itself, then the defaults are looked for in the canvas defaults, and then finally in the module's built in defaults (specified in the descriptions below). Optional attributes will only be assigned in the element definition if they are specified. Fields required to properly define the element (for example, frame for the rectangle element type) will be copied into the element definition with their default values if they are not specified at the time of creation. All canvas elements require the type field all other attributes have default values. element 1 is drawn before element 2, etc.).Īttributes for canvas elements are defined in hs.canvas.attributes. ![]() Elements are rendered in the order in which they are assigned to the array (i.e. The canvas elements are defined in an array, and each entry of the array is a table of key-value pairs describing the element at that position. Included in this assignment list are rules about how the individual elements interact with each other within the canvas (compositing and clipping rules), and direct modification of the canvas itself (move, resize, etc.) causes all of the assigned elements to be adjusted as a group. This module works by designating a canvas and then assigning a series of graphical primitives to the canvas. This model works well with graphical elements that are expected to be managed individually and don't have complex clipping interactions, but does not scale well when more complex combinations or groups of drawing elements need to be moved or manipulated as a group, and only allows for simple inclusionary clipping regions. ![]() Hs.drawing approaches graphical images as independent primitives, each "shape" being a separate drawing object based on the core primitives: ellipse, rectangle, point, line, text, etc. Hammerspoon docs: hs.canvas docs » hs.canvasĪ different approach to drawing in Hammerspoon
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |