Table of Contents

Class CompositeTexture

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll

A single block texture

public class CompositeTexture
Inheritance
CompositeTexture
Inherited Members

Constructors

CompositeTexture()

Creates a new empty composite texture

public CompositeTexture()

CompositeTexture(AssetLocation)

Creates a new empty composite texture with given base texture

public CompositeTexture(AssetLocation Base)

Parameters

Base AssetLocation

Fields

Alpha

Can be used to modify the opacity of the texture

public int Alpha

Field Value

int

AlphaSeparator

public const char AlphaSeparator = 'å'

Field Value

char

AlphaSeparatorRegexSearch

public const string AlphaSeparatorRegexSearch = "å\\d+"

Field Value

string

Alternates

The texture may consists of any amount of alternatives, one of which will be randomly chosen when the block is placed in the world.

public CompositeTexture[] Alternates

Field Value

CompositeTexture[]

Baked

BakedCompositeTexture is an expanded, atlas friendly version of CompositeTexture. Required during texture atlas generation.

public BakedCompositeTexture Baked

Field Value

BakedCompositeTexture

Base

The basic texture for this composite texture

public AssetLocation Base

Field Value

AssetLocation

BlendedOverlays

The base texture may be overlayed with any quantity of textures. These are baked together during texture atlas creation

public BlendedOverlayTexture[] BlendedOverlays

Field Value

BlendedOverlayTexture[]

Rotation

Rotation of the texture may only be a multiple of 90

public int Rotation

Field Value

int

Tiles

public CompositeTexture[] Tiles

Field Value

CompositeTexture[]

TilesWidth

public int TilesWidth

Field Value

int

WildCardNoFiles

public AssetLocation WildCardNoFiles

Field Value

AssetLocation

basicTexturesCache

[ThreadStatic]
public static Dictionary<AssetLocation, CompositeTexture> basicTexturesCache

Field Value

Dictionary<AssetLocation, CompositeTexture>

wildcardsCache

[ThreadStatic]
public static Dictionary<AssetLocation, List<IAsset>> wildcardsCache

Field Value

Dictionary<AssetLocation, List<IAsset>>

Properties

AnyWildCardNoFiles

public AssetLocation AnyWildCardNoFiles { get; }

Property Value

AssetLocation

Overlays

(legacy setter, used BlendedOverlays instead) The base texture may be overlayed with any quantity of textures. These are baked together during texture atlas creation

public AssetLocation[] Overlays { set; }

Property Value

AssetLocation[]

Methods

Bake(IAssetManager)

Expands the Composite Texture to a texture atlas friendly version and populates the Baked field. This method is called by the texture atlas managers. Won't have any effect if called after the texture atlasses have been created.

public void Bake(IAssetManager assetManager)

Parameters

assetManager IAssetManager

Clone()

Creates a deep copy of the texture

public CompositeTexture Clone()

Returns

CompositeTexture

FillPlaceholder(string, string)

public void FillPlaceholder(string search, string replace)

Parameters

search string
replace string

IsBasic()

Tests whether this is a basic CompositeTexture with an asset location only, no rotation, alpha, alternates or overlays

public bool IsBasic()

Returns

bool

RuntimeBake(ICoreClientAPI, ITextureAtlasAPI)

Expands the Composite Texture to a texture atlas friendly version and populates the Baked field. This method can be called after the game world has loaded.

public void RuntimeBake(ICoreClientAPI capi, ITextureAtlasAPI intoAtlas)

Parameters

capi ICoreClientAPI

The Client API

intoAtlas ITextureAtlasAPI

The atlas to insert the baked texture.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.