Files
Basalt2/docs/references/elements/BaseFrame.md
Robert Jelic 3504d8a3aa Docs fix
2025-09-13 12:50:01 +02:00

4.5 KiB

BaseFrame

This is the base frame class. It is the root element of all elements and the only element without a parent.

Extends: Container

Properties

Property Type Default Description
term term peripheral term.current()

Functions

Method Returns Description
BaseFrame.new BaseFrame Creates a new Frame instance
BaseFrame:BaseFrame table Initializes the Frame instance
BaseFrame:BaseFrame - Renders a multiBlit to the render Object
BaseFrame:BaseFrame - Renders a text with a foreground color to the render Object
BaseFrame:BaseFrame - Renders a text with a background color to the render Object
BaseFrame:BaseFrame - Renders a text with a background color to the render Object
BaseFrame:BaseFrame - Renders a text with a foreground and background color to the render Object
BaseFrame:BaseFrame - Sets the cursor position
BaseFrame:BaseFrame - Handles monitor touch events
BaseFrame:BaseFrame - Handles mouse click events
BaseFrame:BaseFrame - Handles mouse up events
BaseFrame:BaseFrame - Resizes the Frame
BaseFrame:BaseFrame - Handles key events
BaseFrame:BaseFrame - Handles key up events
BaseFrame:BaseFrame - Handles character events
BaseFrame:BaseFrame - Renders the Frame

BaseFrame.new()

Creates a new Frame instance

Returns

  • BaseFrame object The newly created Frame instance

Usage

local element = BaseFrame.new()

BaseFrame:BaseFrame(props, basalt)

Parameters

  • props table The properties to initialize the element with
  • basalt table The basalt instance

Returns

  • table self The initialized instance

BaseFrame:BaseFrame(x, y, width, height, text, fg, bg)

Parameters

  • x number The x position to render to
  • y number The y position to render to
  • width number The width of the text
  • height number The height of the text
  • text string The text to render
  • fg string The foreground color
  • bg string The background color

BaseFrame:BaseFrame(x, y, text, fg)

Parameters

  • x number The x position to render to
  • y number The y position to render to
  • text string The text to render
  • fg colors The foreground color

BaseFrame:BaseFrame(x, y, text, bg)

Parameters

  • x number The x position to render to
  • y number The y position to render to
  • text string The text to render
  • bg colors The background color

BaseFrame:BaseFrame(x, y, text, bg)

Parameters

  • x number The x position to render to
  • y number The y position to render to
  • text string The text to render
  • bg colors The background color

BaseFrame:BaseFrame(x, y, text, fg, bg)

Parameters

  • x number The x position to render to
  • y number The y position to render to
  • text string The text to render
  • fg string The foreground color
  • bg string The background color

Sets the cursor position

Parameters

  • x number The x position to set the cursor to
  • y number The y position to set the cursor to
  • blink boolean Whether the cursor should blink

BaseFrame:BaseFrame(name, x, y)

Parameters

  • name string The name of the monitor that was touched
  • x number The x position of the mouse
  • y number The y position of the mouse

BaseFrame:BaseFrame(button, x, y)

Parameters

  • button number The button that was clicked
  • x number The x position of the mouse
  • y number The y position of the mouse

BaseFrame:BaseFrame(button, x, y)

Parameters

  • button number The button that was released
  • x number The x position of the mouse
  • y number The y position of the mouse

BaseFrame:BaseFrame()

BaseFrame:BaseFrame(key)

Parameters

  • key number The key that was pressed

BaseFrame:BaseFrame(key)

Parameters

  • key number The key that was released

BaseFrame:BaseFrame(char)

Parameters

  • char string The character that was pressed

BaseFrame:BaseFrame()