MultiTextureSwitch
- Last UpdatedFeb 21, 2024
- 3 minute read
The Multitextureswitch node enables you to define alternative sets of textures and to switch between them and the default texture.
When you change a texture content, all the graphical elements that use that texture reflect the change.
Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
Create texture sets for switching textures
-
Create a dedicated folder for the alternative sets of textures. We suggest Gamedata/Textures/user.
-
Check whether this folder is included in the config.xmlPlatform.dirs.textures parameter.
-
Create a subfolder for each alternative asset needed. Subfolders must have short names without spaces and special characters. This name is the set name.
-
In each alternative set, put the modified version of the textures.
Each texture must include the XXX_ prefix in its name where XXX is the name of the set (and of the subfolder).
For example, if the subfolder is dark, and the original texture is valveTexture.tga, the alternative texture must be named dark_valveTexture.tga.
-
Create the Multitextureswitch node and specify the base directory and set nam. These must match the subfolder names.
When creating a Multitextureswitch with multiple alternative sets, remember that the sets may include different overridden textures. When switching to a set, all the textures not redefined inside the set appear as their default version.
Code example
This is a code example for the Multitextureswitch node.
<Multitextureswitch name="sky_condition" path="./Gamedata/Textures/user/AlternativeAssets" sets="fog,rain,snow" />
MultiTextureSwitch fields
These are the fields for MultiTextureSwitch node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > MultiTextureSwitch
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
currentSet |
ssint |
Optional |
0 |
Used to perform the switch. Zero (0) means default texture version, 1-n to select the alternative assets. |
|
path |
sstring |
Optional |
Not set |
Base directory for alternative texture. |
|
sets |
mstring |
Optional |
Not set |
List of set names. Subfolder names and texture prefixes must match. |