Component:StaticTexture2D

From Resonite Wiki
Revision as of 06:05, 17 March 2025 by 989onan bot (talk | contribs) (Automated: update Fields, SyncDelegates)


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


Component image 
StaticTexture2D component as seen in the Scene Inspector

The StaticTexture2D Component stores a reference to a static asset representing a 2D 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. Some components stop their functionality when this field is disabled, but some don't.
URL Uri The Asset URI that references the raw texture data
FilterMode Nullable`1<TextureFilterMode> How to handle the interpolation between pixels.
AnisotropicLevel Nullable`1<Int> The levels of Anisotropic filtering distances when using Anisotropic for FilterMode
Uncompressed Bool Do not use texture compression
DirectLoad Bool Whether to load the image directly from it's URI source and to not cache it locally.
ForceExactVariant Bool Only allow one variant of the texture to exist, part of Asset Variant System.
PreferredFormat Nullable`1<TextureCompression> The format to use for texture compression rather than the auto picked one
PreferredProfile Nullable`1<ColorProfile> The color profile to use rather than the auto picked one. (usually linear)
MipMapBias Float Whether to see lower resolution versions of the texture closer up or not (MipMaps).
IsNormalMap Bool This texture should be interpreted as a Normal Map
WrapModeU TextureWrapMode How to repeat or mirror the texture along the X axis. this goes into affect when X values are outside of the range [0.0 to 1.0].
WrapModeV TextureWrapMode How to repeat or mirror the texture along the Y axis. this goes into affect when Y values are outside of the range [0.0 to 1.0].
PowerOfTwoAlignThreshold Float The threshold for pixel count from range [0.0,1.0] before scaling both axes to a power of 2.
CrunchCompressed Bool Whether to compress the texture to extreme lengths to reduce VRam usage.
MinSize Nullable`1<Int>
MaxSize Nullable`1<Int> The maxiumum size to show to the user, which scaled versions are generated by the cloud on the fly from the original and sent as part of the Asset Variant System
MipMaps Bool Whether to enable the rendering of mipmaps, which are lower res textures at further distances from the camera to improve performance.
KeepOriginalMipMaps Bool Whether to use the original mipmaps that came with the image data (yes you could have rainbow mipmaps at further distances) or not.
MipMapFilter Filtering How to apply filtering to the image's mipmaps. please see Filtering!
Readable Bool Whether this can be read per pixel via things like ProtoFlux

Usage

By default Filter is set to Bilinear Filtering, however Anisotropic Filtering results in a much better appearance at very steep angles, and only has a very minor performance impact. If visual fidelity of your texture is a concern, you should set Filter to Anisotropic, and AnisotropicLevel to 4 or 8.

Special Functions

Any of the operations listed below will generate a new static texture asset, and anything referring to this StaticTexture2D component will be updated with the new texture. The existing asset is deleted from the servers if no other items refer to it.

Troubleshooting

When importing images into Resonite, sometimes the image will have a row of pixels taken from the bottom of the image rendered at the top. To fix this issue, go to the FilterMode property on the StaticTexture2D component, click the checkbox, and select "Point". This prevents the issue

Triggers
Method Name Method type and Arguments. Is the method hidden? Description
BleedColorToAlphaFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X
FlipHorizontalFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Flips the image horizontally
FlipVerticalFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Flips the image vertical
Rotate90CWFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Rotates the image by 90° clockwise
Rotate90CCWFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Rotates the image by 90° counterclockwise
Rotate180Func`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Rotates the image by 180°
MakeSquareFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X
TileLoopFunc`2<Float2, Task`1<Bool>> Func`2<Float2, Task`1<Bool>> X
TileMirrorFunc`2<Float2, Task`1<Bool>> Func`2<Float2, Task`1<Bool>> X
RescaleFunc`3<Int, Filtering, Task`1<Bool>> Func`3<Int, Filtering, Task`1<Bool>> X
RescaleFunc`3<Int2, Filtering, Task`1<Bool>> Func`3<Int2, Filtering, Task`1<Bool>> X
CropFunc`3<Int2, Int2, Task`1<Bool>> Func`3<Int2, Int2, Task`1<Bool>> X
TrimFunc`2<Color, Task`1<Bool>> Func`2<Color, Task`1<Bool>> X
TrimFunc`2<Color32, Task`1<Bool>> Func`2<Color32, Task`1<Bool>> X
TrimTransparentFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Stretches the image such that both sides are equal to the longest side
TrimByCornerColorFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X
KMeansClusterFunc`5<Int, Float, Int, Float, Task`1<Bool>> Func`5<Int, Float, Int, Float, Task`1<Bool>> X
TileLoopButtonEventHandler`1<FloatTextEditorParser> ButtonEventHandler`1<FloatTextEditorParser>
TileMirrorButtonEventHandler`1<FloatTextEditorParser> ButtonEventHandler`1<FloatTextEditorParser>
ResizeButtonEventHandler`1<IntTextEditorParser> ButtonEventHandler`1<IntTextEditorParser>
BleedColorToAlphaButtonEventHandler ButtonEventHandler
FlipHorizontalButtonEventHandler ButtonEventHandler
FlipVerticalButtonEventHandler ButtonEventHandler
Rotate90CWButtonEventHandler ButtonEventHandler
Rotate90CCWButtonEventHandler ButtonEventHandler
Rotate180ButtonEventHandler ButtonEventHandler
TrimTransparentButtonEventHandler ButtonEventHandler
TrimByCornerColorButtonEventHandler ButtonEventHandler
MakeSquareButtonEventHandler ButtonEventHandler
ToNearestPOTButtonEventHandler ButtonEventHandler
GenerateBitmapMetadataButtonEventHandler ButtonEventHandler
ReplaceFromClipboardButtonEventHandler ButtonEventHandler
InvertRGBFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Inverts the colors of the texture
InvertRFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Same as above, but only effects the red channel of the texture
InvertGFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Same as above, but only effects the green channel of the texture
InvertBFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Same as above, but only effects the blue channel of the texture
InvertAFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Same as above, but only effects the alpha channel of the texture
ColorToAlphaFunc`2<ColorX, Task`1<Bool>> Func`2<ColorX, Task`1<Bool>> X
AlphaFromIntensityFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Makes the texture transparent based on the intensity of colors in the image.
AlphaToMaskFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Creates a black and white mask texture from an alpha image
RemoveAlphaFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Forces the entire image to full opacity on the alpha channel
GrayscaleAverageFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Converts the image to grayscale based on the average of the red, green and blue channel.
GrayscaleLuminanceFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X
SwapRGFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Swaps the red and green channels on the image
SwapRBFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Swaps the red and blue channels on the image
SwapRAFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X
SwapGBFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X Swaps the green and blue channels on the image
SwapGAFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X
SwapBAFunc`1<Task`1<Bool>> Func`1<Task`1<Bool>> X
AddBackgroundFunc`2<ColorX, Task`1<Bool>> Func`2<ColorX, Task`1<Bool>> X
AdjustGammaFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
AdjustAlphaGammaFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
ShiftHueFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
SetHueFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
SetSaturationFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
OffsetSaturationFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
MulSaturationFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
SetValueFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
MulValueFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
OffsetValueFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
OffsetAlphaFunc`2<Float, Task`1<Bool>> Func`2<Float, Task`1<Bool>> X
NormalizeFunc`4<Bool, Bool, Bool, Task`1<Bool>> Func`4<Bool, Bool, Bool, Task`1<Bool>> X

Examples

See Also