Skip to main content

SceneItem

After creating a scene, you can access specific items using item(). Simply provide an item's ref and it will return the item or undefined if there is no item with the provided ref.

const someItem = someScene.item("someItem");

Creating Items Dynamically​

Scene items don't have to be created at the same time as a scene. You may use createItem() to create an item from a schema at any time after a scene has been created.

await scene.createItem("anotherRef", {
source: anotherSource,
positionX: 0,
enabled: false,
});

This function is used internally by create(), so you can be certain that creation of the item will perform the same way as if it was created at the same time as the scene.

Removing​

Scene items can be removed from their containing scene with remove()

await someItem.remove();

Properties​

  • scene - The scene that the item exists in
  • source - The source that the item is an instance of
  • id - The id of the item in OBS
  • ref - The ref of the item used by Sceneify

These properties can be set with their associated functions: