Mousecrafting
Based on game build 714014 | Last updated: 2026-03-08
Overview
MouseCrafting is a UI widget class used to render and manage the crafting interface for mouse-driven input. It extends the base Crafting widget and configures itself for mouse-specific layout (horizontal orientation, custom positions for UI elements). It is intended to be instantiated as part of the UI layer and does not attach to game entities.
Usage example
local MouseCrafting = require "widgets/mousecrafting"
local crafting_ui = MouseCrafting(owner, NUM_CRAFTING_RECIPES)
-- Add to screen or parent widget as needed
parent:AddChild(crafting_ui)
Dependencies & tags
Components used: None identified (uses internal widget classes only). Tags: None identified.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
in_pos | Vector3 | Vector3(145, 0, 0) | Position offset for input elements within the UI. |
out_pos | Vector3 | Vector3(0, 0, 0) | Position offset for output elements within the UI. |
Main functions
MouseCrafting(owner, num_tabs)
- Description: Constructor for the
MouseCraftingwidget. Initializes the parentCraftingclass, sets orientation to false (horizontal), and configures input/output positions. Enables popups on crafting slots. - Parameters:
owner(Widget or Entity) — The owner of this widget (typically a screen or parent UI container).
num_tabs(number, optional) — Number of crafting tabs to initialize; defaults toNUM_CRAFTING_RECIPESif not provided. - Returns: A new
MouseCraftinginstance. - Error states: None identified.
Events & listeners
None identified.