Class BatchTiledMapRenderer

    • Field Detail

      • unitScale

        protected float unitScale
      • batch

        protected Batch batch
      • imageBounds

        protected Rectangle imageBounds
      • ownsBatch

        protected boolean ownsBatch
      • vertices

        protected float[] vertices
    • Constructor Detail

      • BatchTiledMapRenderer

        public BatchTiledMapRenderer​(TiledMap map)
      • BatchTiledMapRenderer

        public BatchTiledMapRenderer​(TiledMap map,
                                     float unitScale)
      • BatchTiledMapRenderer

        public BatchTiledMapRenderer​(TiledMap map,
                                     Batch batch)
      • BatchTiledMapRenderer

        public BatchTiledMapRenderer​(TiledMap map,
                                     float unitScale,
                                     Batch batch)
    • Method Detail

      • setMap

        public void setMap​(TiledMap map)
      • getUnitScale

        public float getUnitScale()
      • getBatch

        public Batch getBatch()
      • getViewBounds

        public Rectangle getViewBounds()
      • setView

        public void setView​(OrthographicCamera camera)
        Description copied from interface: MapRenderer
        Sets the projection matrix and viewbounds from the given camera. If the camera changes, you have to call this method again. The viewbounds are taken from the camera's position and viewport size as well as the scale. This method will only work if the camera's direction vector is (0,0,-1) and its up vector is (0, 1, 0), which are the defaults.
        Specified by:
        setView in interface MapRenderer
        Parameters:
        camera - the OrthographicCamera
      • setView

        public void setView​(Matrix4 projection,
                            float x,
                            float y,
                            float width,
                            float height)
        Description copied from interface: MapRenderer
        Sets the projection matrix for rendering, as well as the bounds of the map which should be rendered. Make sure that the frustum spanned by the projection matrix coincides with the viewbounds.
        Specified by:
        setView in interface MapRenderer
      • render

        public void render()
        Description copied from interface: MapRenderer
        Renders all the layers of a map.
        Specified by:
        render in interface MapRenderer
      • render

        public void render​(int[] layers)
        Description copied from interface: MapRenderer
        Renders the given layers of a map.
        Specified by:
        render in interface MapRenderer
        Parameters:
        layers - the layers to render.
      • renderMapLayer

        protected void renderMapLayer​(MapLayer layer)
      • beginRender

        protected void beginRender()
        Called before the rendering of all layers starts.
      • endRender

        protected void endRender()
        Called after the rendering of all layers ended.
      • dispose

        public void dispose()
        Description copied from interface: Disposable
        Releases all resources of this object.
        Specified by:
        dispose in interface Disposable