Component/en: Difference between revisions

From Resonite Wiki
Updating to match new version of source page
 
Updating to match new version of source page
 
Line 1: Line 1:
<languages />
<languages />


A Component is something that is attached to a [[Slot]] to add functionality. Components are behind almost every feature in Resonite, ranging from storing data to animating your avatar.
A Component is something that is attached to a [[Slot]] to add functionality. Without components, slots would be nothing but points in a void. They are behind almost every feature in Resonite, ranging from storing data to animating your avatar.


Components have properties. Some are used by the component to keep track of information; others are used to configure the component. Each component page lists all of the properties exposed in the [[Scene Inspector]].
For a list of all components, see [[:Category:Components]]. Components are organized in categories that match the game, so you can use the categories to figure out where to find a component.


You can attach a component to a slot in the scene inspector by clicking the ''Attach Component'' button. This will spawn a list of categories; double-click on a category to enter it, and repeat the process until you find the component you want.
== Basic Properties ==


For a list of all components, see [[:Category:Components]]. There is also a list of [[Components]] on another page which we are in the process of merging with this one and the category listings.
=== Fields ===


{{stub}}
Components contain fields, store data on the component for configuration, internal operation and output. Pages on individual components go in-depth on each component and their fields.
 
All components include at least the following built-in fields:
 
{{Table TypeFields
|persistent|Bool|The <code>persistent</code> field determines whether this component will be saved, for example to the [[Inventory|Inventory]]. If this field is set to <code>false</code>, the component will not be persisted when saved.
|UpdateOrder|Int|Controls the order in which this component updates, relative to all other components in the [[World|World]]. Components with a higher value will update after components with a lower value.
 
Many components do not implement their functionality via the common updating system. This field has no effect on such components.
|Enabled|Bool|Controls whether this component this component is "enabled". Generally, components that are disabled (this field set to <code>false</code>) should do nothing.
 
Not all components respect this property. This field has no effect on such components.
}}
== Working With Components ==
 
=== With the Scene Inspector ===
 
As a user, components are primarily manipulated through the [[Scene Inspector|Scene Inspector]]. It allows you to create and destroy components and manipulate their fields. Many components also have custom functionality (commonly through various buttons) available in the inspector interface.
 
=== With ProtoFlux ===
 
[[ProtoFlux]] currently has limited ability to directly interact with components.<ref>{{CiteResoniteIssue|57|A way to use components on Protoflux}}</ref> It is not possible to dynamically create, destroy or locate components in slots.
 
== References ==

Latest revision as of 09:56, 23 May 2024

A Component is something that is attached to a Slot to add functionality. Without components, slots would be nothing but points in a void. They are behind almost every feature in Resonite, ranging from storing data to animating your avatar.

For a list of all components, see Category:Components. Components are organized in categories that match the game, so you can use the categories to figure out where to find a component.

Basic Properties

Fields

Components contain fields, store data on the component for configuration, internal operation and output. Pages on individual components go in-depth on each component and their fields.

All components include at least the following built-in fields:

Fields
Name Type Description
persistent Bool The persistent field determines whether this component will be saved, for example to the Inventory. If this field is set to false, the component will not be persisted when saved.
UpdateOrder Int Controls the order in which this component updates, relative to all other components in the World. Components with a higher value will update after components with a lower value.

Many components do not implement their functionality via the common updating system. This field has no effect on such components.

Enabled Bool Controls whether this component this component is "enabled". Generally, components that are disabled (this field set to false) should do nothing.

Not all components respect this property. This field has no effect on such components.

Working With Components

With the Scene Inspector

As a user, components are primarily manipulated through the Scene Inspector. It allows you to create and destroy components and manipulate their fields. Many components also have custom functionality (commonly through various buttons) available in the inspector interface.

With ProtoFlux

ProtoFlux currently has limited ability to directly interact with components.[1] It is not possible to dynamically create, destroy or locate components in slots.

References