Discord

Preparing your files

Please wait until the download is ready.

Luka's Scripting Utilities

Luka's Scripting Utilities

by Luka S.J.

A pack full of various scripting utilities to ease your development!

v4.1.135,194
Download144 KB

UI Window (9-slice)

LUTS::UI::Window is a Sprites::Base subclass that renders a windowskin to a
bitmap using 9-slice scaling — the corners stay fixed while the edges and
centre stretch to fill the requested size. This lets one small skin graphic
produce a crisp window box at any dimension.

window = LUTS::UI::Window.new(viewport)
window.set_bitmap(
  width:  240,
  height: 120,
  path:   "Graphics/Windowskins/box",
  slice:  16
)
  • window.set_bitmap(width:, height:, path:, slice:) build the windowskin bitmap at width × height from the source image at path, using slice as the corner/edge boundary that defines the stretchable centre region

Because it inherits Sprites::Base, you also get all of its positioning,
colour and animation helpers on the resulting window sprite.