blob: ec12930c8d9cde05f5f96a339c7db7a5b7c93164 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#ifndef WORLDSCENE_HPP
#define WORLDSCENE_HPP
#include "Scene.hpp"
#include "Map.hpp"
#include <SFML/Graphics.hpp>
class WorldScene : public Scene
{
public:
constexpr static float MAX_ZOOM = 10;
constexpr static float MIN_ZOOM = 1/2.0;
constexpr static int DEFAULT_TILE_SIZE_PX = 20;
WorldScene(sf::RenderWindow &window);
virtual void render();
virtual void resize(const sf::Event::SizeEvent &size);
virtual void zoom(float factor);
virtual void pan(int dx, int dy);
private:
Map map;
unsigned _tileSize;
int _panX = 0;
int _panY = 0;
};
#endif
|