GetTexture

Category: Landscape / Material
Since engine version: 4.0 OC

Description

Returns the name of the texture used for the material at the given position.

Syntax

string GetTexture(int x, int y);

Parameters

x:
X coordinate at which to check the texture. Offset in local calls.
y:
Y coordinate at which to check the texture. Offset in local calls.

Example

func ControlUse(object clonk)
{
var tex_name = clonk->GetTexture(0,0);
var tex_color = GetAverageTextureColor();
clonk->SetColor(tex_color); clonk->PlayerMessage(clonk->GetOwner(), "Camoflaging Clonk to look like %s", tex_name);
}
A script for a carmoflage item. When used, the clonk's overlay color is set to the average color of the texture where he is currently standing and he announces the name of the texture he is carmoflaging as.
See also: GetAverageTextureColor, GetBackTexture