Skip to content

pixso.stickyToolbar

pixso.stickyToolbar is the abstraction for the layer floating toolbar. The floating toolbar is closed by default and must be enabled with pixso.stickyToolbar.open(tools).

After it is enabled, when a single layer is selected on the canvas, the floating toolbar is displayed around that layer. Menu items in the floating toolbar can be configured through the tools parameter.

In addition, the on and once methods on pixso.stickyToolbar can listen for mouse-triggered events on menu items, such as click, mouse enter, and mouse leave.

open

  • Type: open(tools: ToolItem[]): void
  • Type Declaration: ToolItem
  • Tip: cross-thread communication

Open the layer floating toolbar.

close

  • Type: close(): void
  • Tip: cross-thread communication

Close the layer floating toolbar.

position

Position setting for the floating toolbar. Defaults to TOP_CENTER.

display

Display condition for the floating toolbar. Defaults to SELECT, which means the toolbar is displayed when a layer is selected. When set to HOVER_SELECT, the toolbar is displayed only when the mouse hovers over the selected layer.

on

on(type: "trigger", callback: (event: StickyToolbarEvent) => void): void;

Registers an event handler for a specific layer floating toolbar event. The callback is executed when the event occurs.

  • trigger: mouse-triggered event for a floating-toolbar menu item, such as click, mouse enter, and mouse leave. Use event.type to distinguish the mouse event type.

once

once(type: "trigger", callback: (event: StickyToolbarEvent) => void): void;

Registers an event handler for a specific layer floating toolbar event. Unlike on, an event handler registered through once is executed only once.

off

off(type: "trigger", callback: (event: StickyToolbarEvent) => void): void;

Removes an event handler bound through pixso.stickyToolbar.on or pixso.stickyToolbar.once.