Skip to content

Class DrawableWindow ​

A live picture of a window, made with Drawable.window. Use it for previews, overviews and switchers.

Extends: Drawable

Drawable.window(spec) takes the same fields by name: the ones below and the shared ones. window is required. Without a width or height, the picture takes the window's own size on that axis.

A preview of another window in the top-right corner, above fullscreen windows:

lua
local preview = Drawable.window({
	window = other,
	right = 16, top = 16, width = 320, height = 200,
	fit = "contain", layer = "overlay",
})
output.drawables:add(preview)

Properties ​

drawable.window: Window?window ​

The window shown, scaled into the box.

  • The picture takes no input. The window itself is still drawn as usual unless its box.visible is false.
  • The picture of a hidden window keeps updating.
  • When the window closes, this reads nil. The picture keeps showing the window's last frame until window is set or the drawable leaves every list.
  • nil shows nothing.

drawable.popups: booleanpopups ​

Whether the window's popups are drawn on top of the picture.

  • Default: false.

drawable.fit: "stretch" | "contain" | "cover"fit ​

How the picture fills its box.

  • Default: "stretch".
  • "stretch": the whole window, squeezed to the box.
  • "contain": the whole window as large as fits, centred.
  • "cover": fills the box, cropping the window's centre to it.