public class Material

  1. Object
  2. Material
A pluggable surface material used by terrain cells and TerrainFeatures. A material is referenced everywhere by its string #getId() and resolved through the MaterialRegistry, so applications can register their own materials (sand, lava, ice, …) without changing the level format. Carries authoring + light-runtime hints (base colour, whether it blocks movement, friction) plus an optional #getArtId() for textured rendering.

Constructors

public Material()
public Material(String id, String name, int color)

Methods

public String getId()
public Material setId(String id)
public String getName()
public Material setName(String name)
public int getColor()Base RGB colour (0xRRGGBB) used to render the material before art is applied.
public Material setColor(int color)
public boolean isSolid()Whether walkers are blocked by this material (e.g. water, lava).
public Material setSolid(boolean solid)
public double getFriction()Movement friction multiplier (1 = normal, <1 = slippery like ice).
public Material setFriction(double friction)
public String getArtId()Optional asset id supplying the material’s texture art (resolved via AssetCatalog).
public Material setArtId(String artId)
public Map<String, Object> props()Free-form authoring properties for app-specific material data.

Inherited methods

Constructor details

Material

public Material()

Material

public Material(String id, String name, int color)

Method details

getId

public String getId()

setId

public Material setId(String id)

getName

public String getName()

setName

public Material setName(String name)

getColor

public int getColor()
Base RGB colour (0xRRGGBB) used to render the material before art is applied.

setColor

public Material setColor(int color)

isSolid

public boolean isSolid()
Whether walkers are blocked by this material (e.g. water, lava).

setSolid

public Material setSolid(boolean solid)

getFriction

public double getFriction()
Movement friction multiplier (1 = normal, <1 = slippery like ice).

setFriction

public Material setFriction(double friction)

getArtId

public String getArtId()
Optional asset id supplying the material’s texture art (resolved via AssetCatalog).

setArtId

public Material setArtId(String artId)

props

public Map<String, Object> props()
Free-form authoring properties for app-specific material data.