Skip to content

1. Getting Started

Alexandria W. edited this page Jun 25, 2025 · 2 revisions

Requiring

Getting started with Frame is super simple! Like other assets you download, you will need to require the script to use it.

To do this, simply require FrameLib and store it to a variable. This example will store it as a variable called frame.

local frame = require("FrameLib")

For more information on requiring scripts, view the Figura Wiki - Globals > Misc Globals > require()

Using Frame

Frame is a field oriented library, meaning it uses setting values instead of calling functions. All Frame functions use . instead of : for indexing of functions

When using Frame, you will need to create layers. Each layer takes a texture, a name (optional), and a configuration (optional). By default when you create a layer, it is centered and fitted to the screen.

Creating Layers

As an example, we'll create a new layer and store it inside a variable called myLayer. This layer will also be given a name. Names can be different from the variable they are stored in, but no two layers can share a name.

image

local myLayer = frame.newLayer(
  textures:fromVanilla("Apple", "textures/item/apple.png"), -- Texture
  "Apple", -- Layer name
  {} -- Configuration
)

All custom textures must be stored inside a bbmodel in order for Figura to see it. For help on indexing custom textures, view the Figura Wiki - Globals > Textures > Textures

For more information on layer names, [Link to that page]

Removing Layers

Layers can also be removed by their layer name. As an example, we will remove the layer we just created above.

frame.removeLayer("Apple")

Clone this wiki locally