Skip to content

2. Examples

Jere edited this page Sep 6, 2025 · 3 revisions

Overview

Here are some examples on how to trigger some specific actions inside the Pogly instance. This assumes all the code is inside of a command's execute method.

For full set of StDBHelper methods, check out StDBHelper.

Changing layout

// Sets the active layout to be "Runescape".
const stdb: StDBHelper = new StDBHelper();
stdb.SetLayoutActiveByName("Runescape");

Spawn text

const stdb: StDBHelper = new StDBHelper();
const layout: Layouts = stdb.GetActiveLayout();

stdb.SpawnText("Hello World!", layout);

Edit text

// 1 Is the Elements ID on the canvas.
const stdb: StDBHelper = new StDBHelper();
stdb.EditTextByID(1, "Bye World!");

Spawn image

// Spawns the image with ElementData ID 1.
const stdb: StDBHelper = new StDBHelper();
const layout: Layouts = stdb.GetActiveLayout();

stdb.SpawnImage(1, layout);

Edit image

// 1 Is the Elements ID on the canvas.
const stdb: StDBHelper = new StDBHelper();
stdb.EditImageByID(1, "https://i.imgur.com/zEiKtsL.png");

Spawn widget

// Spawns the widget with ElementData ID 1.
const stdb: StDBHelper = new StDBHelper();
const layout: Layouts = stdb.GetActiveLayout();

stdb.SpawnWidget(1, layout);

Edit widget variable

// 1 Is the Elements ID on the canvas.
// Title is the variable name
// Welcome! is the new value
const stdb: StDBHelper = new StDBHelper();
stdb.EditWidgetVariable(1, "title", "Welcome!");

Clone this wiki locally