Component:ItemTextureThumbnailSource: Difference between revisions

From Resonite Wiki
Zandario (talk | contribs)
m LogiX -> ProtoFlux, also updated the example
 
This component appears to not take effect if it is not on the root slot of an object
 
(3 intermediate revisions by 3 users not shown)
Line 6: Line 6:
}}
}}


== Introduction ==
{{PAGENAME}} can be used to customize the inventory preview of an item, setting it to a texture.
{{PAGENAME}} can be used to customize the inventory preview of an item, setting it to a texture.


Line 11: Line 12:
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Texture|IAssetProvider`1|TypeString0=IAssetProvider<Texture2D>|The texture that should be used as the item's inventory preview. If null, the component will be ignored.
|Texture|{{RootFieldType|AssetRef`1|[[Type:Texture2D|Texture2D]]}}|TypeAdv0=true|The texture that should be used as the item's inventory preview. If null, the component will be ignored.
|Crop|Nullable`1|TypeString1=Nullable<Rect>|The rectangle that defines what section of the image to use. (Or null to use the entire image)
|Crop|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Rect|Rect]]&gt;'''|TypeAdv1=true|The rectangle that defines what section of the image to use. (Or null to use the entire image)
}}
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
To work, the component just needs to be attached to any slot in the object's hierarchy and have an image in its <code>Texture</code>.
To work, the component needs to be attached to the object's root slot and have an image in its <code>Texture</code>. The <code>Ensure single thumbnail source</code> button can be used to remove all other instances of the component in the item's hierarchy.  


<!--T:4-->
<!--T:4-->
Line 30: Line 31:
<!--T:6-->
<!--T:6-->
== Related Components ==
== Related Components ==
[[Category:Components|Texture Thumbnail Source]]
[[Category:Components:Uncategorized{{#translation:}}|Item Texture Thumbnail Source]]
[[Category:Components:Uncategorized|Texture Thumbnail Source]]
[[Category:Components{{#translation:}}|Item Texture Thumbnail Source]]

Latest revision as of 09:19, 3 June 2024


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
Texture Thumbnail Source component as seen in the Scene Inspector


Introduction

ItemTextureThumbnailSource can be used to customize the inventory preview of an item, setting it to a texture.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
Texture Texture2D The texture that should be used as the item's inventory preview. If null, the component will be ignored.
Crop Nullable`1<Rect> The rectangle that defines what section of the image to use. (Or null to use the entire image)

Usage

To work, the component needs to be attached to the object's root slot and have an image in its Texture. The Ensure single thumbnail source button can be used to remove all other instances of the component in the item's hierarchy.

Examples

This component can be used when the automatically generated preview for an item isn't satisfying enough or you want to ensure that the preview looks the same every time or shows the item off in a certain way.

An example of an item that uses this is default Tools in the Resonite Essentials > Tools folder.

Related Issues

This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Related Components