1 package ru
.deadsoftware
.cavecraft
;
3 import com
.badlogic
.gdx
.graphics
.OrthographicCamera
;
4 import com
.badlogic
.gdx
.graphics
.g2d
.SpriteBatch
;
5 import com
.badlogic
.gdx
.graphics
.glutils
.ShapeRenderer
;
7 public abstract class Renderer
{
9 public OrthographicCamera camera
;
10 public ShapeRenderer shapeRenderer
;
11 public SpriteBatch spriteBatch
;
16 public Renderer(float width
, float height
) {
17 camera
= new OrthographicCamera();
18 shapeRenderer
= new ShapeRenderer();
19 spriteBatch
= new SpriteBatch();
20 camera
.setToOrtho(true, width
, height
);
21 shapeRenderer
.setProjectionMatrix(camera
.combined
);
22 spriteBatch
.setProjectionMatrix(camera
.combined
);
25 public float getWidth() {
26 return camera
.viewportWidth
;
29 public float getHeight() {return camera
.viewportHeight
;}
31 public abstract void render();