Class Map

  • All Implemented Interfaces:
    Disposable
    Direct Known Subclasses:
    TiledMap

    public class Map
    extends java.lang.Object
    implements Disposable
    A generic level map implementation.

    A map has MapProperties which describe general attributes. Availability of properties depends on the type of map, e.g. what format is was loaded from etc.

    A map has MapLayers. Map layers are ordered and indexed. A MapLayer contains MapObjects which represent things within the layer. Different types of MapObject are available, e.g. CircleMapObject, TextureMapObject, and so on.

    A map can be rendered by a MapRenderer. A MapRenderer implementation may chose to only render specific MapObject or MapLayer types.

    There are more specialized implementations of Map for specific use cases. e.g. the TiledMap class and its associated classes add functionality specifically for tile maps on top of the basic map functionality.

    Maps must be disposed through a call to dispose() when no longer used.
    • Constructor Detail

      • Map

        public Map()
        Creates empty map
    • Method Detail

      • getLayers

        public MapLayers getLayers()
        Returns:
        the map's layers
      • getProperties

        public MapProperties getProperties()
        Returns:
        the map's properties
      • dispose

        public void dispose()
        Disposes all resources like Texture instances that the map may own.
        Specified by:
        dispose in interface Disposable