Dynamic Textures
A dynamic texture is a texture that is decided while the game runs instead of being a fixed file. It can switch between files based on what the player is doing, use the player's own skin, or be built from several images that Palladium combines for you. Typical uses are a suit that changes its look with an ability, a helmet that dissolves frame by frame during a transformation, or glowing eyes drawn exactly where the player placed them.
Dynamic textures work anywhere Palladium accepts a texture reference: render layers, power renderer models, icons, GUI widgets and backgrounds, textured beams and the ability bar.
Two Ways to Use Them
As a standalone file
Dynamic texture files are client-side assets:
assets/<namespace>/palladium/dynamic_textures/<filename>.json
They are referenced with a # in front of the ID. The file assets/mypack/palladium/dynamic_textures/hero_suit.json becomes #mypack:hero_suit:
{
"texture": "#mypack:hero_suit"
}
Without the # the same string would be read as a normal texture path. Standalone files are the way to go when several render layers, icons or widgets share the same dynamic texture.
Inline in a render layer
Render layers also accept the dynamic texture object directly in their texture field, so you do not need an extra file for a texture that is only used once:
{
"texture": {
"base": "mypack:textures/entity/hero_suit_#MODE.png",
"variables": {
"MODE": {
"type": "palladium:crouching",
"on_true": "stealth",
"on_false": "normal"
}
}
}
}
Inline objects only work in render layers. Every other texture field takes a texture reference, which means a plain path or a # reference to a standalone file.
Texture Types
The type field selects how the texture is produced. If it is left out, the Configured Texture is used, which is why the examples above have no type.