Skip to main content

Decor Pictureframe

Based on game build 714014 | Last updated: 2026-03-05

Overview

The decor_pictureframe prefab represents a wall-mounted picture frame that can display a drawn image. It integrates with the drawable, inventoryitem, and burnable components to manage display state, visual representation, and fire interaction. When an image is drawn on the frame, it overrides its in-game texture and dynamically updates its display name and inventory icon. The frame supports saving/loading of the drawn image name and responds to state changes such as burning or extinguishing.

Usage example

local frame = SpawnPrefab("decor_pictureframe")
frame.Transform:SetPosition(x, y, z)
frame.components.drawable:Draw(image_name, source_prefab)

Dependencies & tags

Components used: drawable, furnituredecor, inspectable, inventoryitem, burnable, hauntable, smallpropagator
Tags: Adds drawable and furnituredecor

Properties

PropertyTypeDefault ValueDescription
_imagenamenet_string""Networked string storing the name of the currently drawn item (e.g., "wood"). Updated via SetImageNameAndIcon().
displaynamefnfunctionitem_frame_displaynamefnCallback used to compute the display name based on the drawn image.
RefreshImagefunctionRefreshImagePublic function to manually refresh the inventory icon; used by prefabskin.lua.

Main functions

SetImageNameAndIcon(inst, name)

  • Description: Updates the internal _imagename value and triggers updates to the display name override, inventory icon, and animation symbol overrides. Called internally on draw/clear and save/load.
  • Parameters: name (string) – Name of the drawn item (e.g., "wood"), or "" to clear the image.
  • Returns: Nothing.

RefreshImage(inst)

  • Description: Refreshes the inventory item’s imagename property to reflect the current drawing state. Ensures the inventory icon matches the animated display state.
  • Parameters: None.
  • Returns: Nothing.

item_frame_ondrawn(inst, image, src, atlas, bgimage, bgatlas)

  • Description: Callback set on the drawable component. Handles visual updates when an image is drawn or cleared: sets/resets animation symbol overrides (SWAP_SIGN, SWAP_SIGN_BG), toggles draw state (candraw), and updates display metadata.
  • Parameters:
    • image (string? or table?) – Name of the drawn image or nil when cleared.
    • src (Entity or nil) – The source entity that provided the drawn image, used for its drawnameoverride or display name.
    • atlas, bgatlas (string?) – Optional custom atlas paths.
    • bgimage (string? or nil) – Optional background image name.
  • Returns: Nothing.

GetStatus(inst)

  • Description: Provides the current status string for use in the inspection UI. Returns "UNDRAWN" if no image is currently displayed; otherwise returns nil.
  • Parameters: None.
  • Returns: "UNDRAWN" (string) if undrawn, or nil.

Events & listeners

  • Listens to: imagenamedirty (client-side only) – triggers OnImageNameDirty() to update drawnameoverride on non-master simulations.
  • Pushes: None directly; relies on inventoryitem:ChangeImageName() which fires imagechange.