Class Region
java.lang.Object
com.codename1.gaming.level.Region
A loadable area of a large world: its own streaming
Terrain, placed GameElements and a
world-space origin (#getOriginX(),#getOriginZ() in tile units). Regions are linked to
neighbours by named edges (#link(String,String), e.g. "east" -> "desert-2"), so a
GameWorld can stream the adjacent regions in and out for seamless transitions as the
player crosses a boundary. A region serializes independently as its own document.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double worldX, double worldZ) Returns true if the world point (tile units) falls inside this region's bounds; an unbounded region (width/depth 0) contains everything at/after its origin only loosely (callers use neighbor links for transitions instead).elements()static RegiondoublegetDepth()getId()getName()doubledoubledoublegetWidth()Links a named edge of this region to a neighbouring region id.props()setOrigin(double x, double z) setSpan(double width, double depth) setTerrain(StreamingTerrain terrain) terrain()The region's streaming terrain (created lazily; chunk-paged so a region can be huge).toJson()
-
Constructor Details
-
Region
public Region() -
Region
-
-
Method Details
-
getId
-
setId
-
getName
-
setName
-
getOriginX
public double getOriginX() -
getOriginZ
public double getOriginZ() -
setOrigin
-
getWidth
public double getWidth() -
getDepth
public double getDepth() -
setSpan
-
terrain
The region's streaming terrain (created lazily; chunk-paged so a region can be huge). -
setTerrain
-
elements
-
contains
public boolean contains(double worldX, double worldZ) Returns true if the world point (tile units) falls inside this region's bounds; an unbounded region (width/depth 0) contains everything at/after its origin only loosely (callers use neighbor links for transitions instead). -
link
-
neighbors
-
props
-
toJson
-
fromJson
-