Class TerrainFeature

java.lang.Object
com.codename1.gaming.level.TerrainFeature

public class TerrainFeature extends Object
A placed, variable-size terrain element such as a wall, ramp or platform. Unlike a per-cell height/wall value, a feature has a free world position (in tile units) and an arbitrary widthxheightxdepth plus rotation, so dungeon walls, sloped roads and raised platforms of any size are first-class, dynamic objects. The #getType() names the shape family (#TYPE_WALL, #TYPE_RAMP, #TYPE_PLATFORM) and #getMaterial() its surface.
  • Field Details

  • Constructor Details

    • TerrainFeature

      public TerrainFeature()
    • TerrainFeature

      public TerrainFeature(String id, String type)
  • Method Details

    • getId

      public String getId()
    • setId

      public TerrainFeature setId(String id)
    • getType

      public String getType()
    • setType

      public TerrainFeature setType(String type)
    • getX

      public double getX()
    • getY

      public double getY()
    • getZ

      public double getZ()
    • setPosition

      public TerrainFeature setPosition(double x, double y, double z)
      Sets the feature's world position in tile units (y = elevation).
    • getWidth

      public double getWidth()
    • getHeight

      public double getHeight()
    • getDepth

      public double getDepth()
    • setSize

      public TerrainFeature setSize(double width, double height, double depth)
      Sets the feature size in tile units.
    • getRotation

      public double getRotation()
    • setRotation

      public TerrainFeature setRotation(double rotation)
    • getMaterial

      public String getMaterial()
    • setMaterial

      public TerrainFeature setMaterial(String material)
    • props

      public Map<String,Object> props()