1 /*******************************************************************************
\r
2 * Copyright 2011 See AUTHORS file.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
15 ******************************************************************************/
17 package com.badlogic.gdx.maps;
19 import com.badlogic.gdx.graphics.OrthographicCamera;
20 import com.badlogic.gdx.math.Matrix4;
23 * @brief models a common way of rendering Map objects
25 public interface MapRenderer {
27 * Sets the projection matrix and viewbounds from the given camera. If
28 * the camera changes, you have to call this method again. The viewbounds
29 * are taken from the camera's position and viewport size as well as the
30 * scale. This method will only work if the camera's direction vector
31 * is (0,0,-1) and its up vector is (0, 1, 0), which are the defaults.
32 * @param camera the {@link OrthographicCamera}
34 public void setView(OrthographicCamera camera);
37 * Sets the projection matrix for rendering, as well as the bounds of the map
38 * which should be rendered. Make sure that the frustum spanned by the projection
39 * matrix coincides with the viewbounds.
40 * @param projectionMatrix
43 * @param viewboundsWidth
44 * @param viewboundsHeight
46 public void setView(Matrix4 projectionMatrix, float viewboundsX, float viewboundsY, float viewboundsWidth, float viewboundsHeight);
49 * Renders all the layers of a map.
53 /** Renders the given layers of a map.
57 public void render(int[] layers);