Modding:CompositeTexture: Difference between revisions
(Created page with "[https://apidocs.vintagestory.at/api/Vintagestory.API.Client.CompositeTexture.html CompositeTexture] is the type of the json object stored in the <code>textures</code> property of blocks and items. Here is an example from a block with the surrounding textures dictionary. Note that the composite texture is only the part that contains the "base" field. <syntaxhighlight lang='json'> textures: { all: { base: "block/glass/{type}" }, } </syntaxhighlight> == Properties ==...") |
|||
Line 130: | Line 130: | ||
<td>integer</td> | <td>integer</td> | ||
<td>255</td> | <td>255</td> | ||
<td>255 | <td>255 keeps the input alpha channel without altering it. Other values are a percentage to adjust the texture alpha channel. For example, 200 doubles the alpha channel in the input image.</td> | ||
<td>-</td> | <td>-</td> | ||
</tr> | </tr> |
Revision as of 06:55, 4 November 2023
CompositeTexture is the type of the json object stored in the textures
property of blocks and items. Here is an example from a block with the surrounding textures dictionary. Note that the composite texture is only the part that contains the "base" field.
textures: {
all: { base: "block/glass/{type}" },
}
Properties
Property | Type | Default | Usage | Reference |
---|---|---|---|---|
CompositeTexture |
||||
base |
string | required | The asset location of the main texture. | Any block |
overlays |
deprecated: array of strings | empty | Asset locations for overlays. Use blendedoverlays instead. | - |
blendedoverlays |
array of overlays | empty | Combines the overlay textures with the base texture. | door |
Each entry of the array is a simplified texture, with the fields { base: "block/wood/debarked/{wood}", blendedOverlays: [{ base: "block/wood/door/overlay-wide", blendMode: "Overlay" }] }
The available blend modes are:
|
||||
alternates |
array of composite textures | empty | If alternates are present, every time a block is placed in the world, either the base texture or one of the alternates is randomly chosen. Alternates can also be chosen through a base wildcard. | rock |
The top level rotation and overlay properties do not apply to alternates, but those property can be set directly on each alternate. Example that directly specifies the alternatives: {
base: "block/clay/hardened/{type}1",
alternates: [{ base: "block/clay/hardened/{type}2"}, { base: "block/clay/hardened/{type}3" }],
}
Example that uses the base wildcard to specify alternates. Every file matching the wildcard is registered as an alternative. { base: "block/stone/rock/{rock}*" }
|
||||
tiles |
array of composite textures | empty | Similar to alternates , this is a list of different textures to use. The difference is that these alternate textures are used in a repeating grid pattern. |
tilingcobblestonetest |
{
base: "block/stone/cobblestone/tiling/1",
tiles: [
{ base: "block/stone/cobblestone/tiling/*" }
],
tilesWidth: 4
}
|
||||
tilesWidth |
integer | 0 | The width of the tile grid. Every this many textures from tiles forms a new tile row. This property only has an effect if tiles non-empty. |
tilingcobblestonetest |
rotation |
integer | 0 | Amount to rotate the texture counter-clockwise. The number must be a multiple of 90. | planks |
alpha |
integer | 255 | 255 keeps the input alpha channel without altering it. Other values are a percentage to adjust the texture alpha channel. For example, 200 doubles the alpha channel in the input image. | - |
For example, 50 would half the alpha values in the texture (make it more transparent), and 200 would double the alpha values in the texture (make it more opaque). |
Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.
Modding | |
---|---|
Modding Introduction | Getting Started • Theme Pack |
Content Modding | Content Mods • Developing a Content Mod • Basic Tutorials • Intermediate Tutorials • Advanced Tutorials • Content Mod Concepts |
Code Modding | Code Mods • Setting up your Development Environment |
Property Overview | Item • Entity • Block • Block Behaviors • Block Classes • Block Entities • Block Entity Behaviors • World properties |
Workflows & Infrastructure | Modding Efficiency Tips • Mod-engine compatibility • Mod Extensibility • VS Engine |
Additional Resources | Community Resources • Modding API Updates • Programming Languages • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |