Text Functions - Windower/Lua GitHub Wiki

This page contains information on all functions provided within the windower.text table.

Note that these functions are very rudimentary and involve a lot of work to get simple things done. The text objects created will not update, save their properties, or be draggable. To get any of that functionality, use the Texts Library.


Each of these functions takes a name parameter which identifies the text object to modify.

windower.text.create(name)

Creates a text object.

windower.text.delete(name)

Destroys a text object.

windower.text.get_extents(name)

Returns two values, the x and y of its size.

windower.text.get_location(name)

Returns two values, the x and y of its top-left position.

windower.text.set_bg_border_size(name, px)

  • px integer - Pixels

Sets the border size.

windower.text.set_bg_color(name, alpha, red, green, blue)

  • alpha integer - Alpha value, 0 to 255
  • red integer - Red value, 0 to 255
  • green integer - Green value, 0 to 255
  • blue integer - Blue value, 0 to 255

Sets the color of the text background.

windower.text.set_bg_visibility(name, visible)

  • `` bool - true or `false`

Sets the visible of the text background.

windower.text.set_bold(name, bold)

  • `` bool - true or `false`

Sets the font bold, if true was specified, otherwise resets to the non-bold default.

windower.text.set_color(name, alpha, red, green, blue)

  • alpha integer - Alpha value, 0 to 255
  • red integer - Red value, 0 to 255
  • green integer - Green value, 0 to 255
  • blue integer - Blue value, 0 to 255

Sets the color of the font.

windower.text.set_font(name, font1, font2, [...])

  • fontx string - Font name

Sets the text object's font to the specified font, if available. Can now accept multiple fonts as fallbacks if the previous is not installed

windower.text.set_font_size(name, size)

  • size integer - Font size

Sets the text object's font size.

windower.text.set_italic(name, italic)

  • italic bool - true or false

Sets the font italic, if true was specified, otherwise resets to the non-italic default.

windower.text.set_location(name, x, y)

  • x integer - Horizontal position
  • y integer - Vertical position

Moves the text object to the specified pixel coordinates.

windower.text.set_right_justified(name, justified)

  • name string - Name of the text object
  • justified bool - true or false

Right-justifies the text object, if true is provided, otherwise resets it to the left-justified default.

windower.text.set_stroke_color(name, alpha, red, green, blue)

  • name string - Name of the text object
  • alpha integer - Transparency value, 0 to 255
  • red integer - Red amount, 0 to 255
  • green integer - Green amount, 0 to 255
  • blue integer - Blue amount, 0 to 255

Sets the text outline's stroke color and transparency.

windower.text.set_stroke_width(name, width)

  • name string - Name of the text object
  • width number - Stroke size in pixels

Sets the text outline's stroke width in pixels.

windower.text.set_text(name, text)

  • text string - The text to display

Sets the text to display in the text object.

windower.text.set_visibility(name, visible)

  • visible bool - true or false

Sets the visible of the text object.