Class Material
java.lang.Object
com.codename1.gaming.level.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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArtId()Optional asset id supplying the material's texture art (resolved viaAssetCatalog).intgetColor()Base RGB colour (0xRRGGBB) used to render the material before art is applied.doubleMovement friction multiplier (1 = normal, <1 = slippery like ice).getId()getName()booleanisSolid()Whether walkers are blocked by this material (e.g. water, lava).props()Free-form authoring properties for app-specific material data.setColor(int color) setFriction(double friction) setSolid(boolean solid)
-
Constructor Details
-
Material
public Material() -
Material
-
-
Method Details
-
getId
-
setId
-
getName
-
setName
-
getColor
public int getColor()Base RGB colour (0xRRGGBB) used to render the material before art is applied. -
setColor
-
isSolid
public boolean isSolid()Whether walkers are blocked by this material (e.g. water, lava). -
setSolid
-
getFriction
public double getFriction()Movement friction multiplier (1 = normal, <1 = slippery like ice). -
setFriction
-
getArtId
Optional asset id supplying the material's texture art (resolved viaAssetCatalog). -
setArtId
-
props
-