#include "Map/Map.h"
#include "Camera.h"
#include "TextureContainer/TextureContainer.h"
#include <iostream>
int main() {
sf::RenderWindow window(sf::VideoMode(1920, 1080), "Test", sf::Style::Default);
sf::Event event;
Map map("Map\\Map.txt", "Map\\GameObjectsMap.txt");
sf::Vector2f camera_pos(300, 300);
sf::Vector2f camera_size(300, 300);
Camera camera(camera_size, camera_pos, &window, sf::Vector2i(32 * map.getSize().x, 32 * map.getSize().y));
bool is_active = true;
sf::Text nickname;
nickname.setFont(TextureContainer::getInstance()->getFont());
nickname.setCharacterSize(15);
nickname.setString("nickname");
nickname.setPosition(280, 280);
while (is_active) {
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed) {
is_active = false;
window.close();
}
}
camera.update();
window.setView(*camera.getView());
window.clear();
window.draw(map);
window.draw(nickname);
window.display();
}
return 0;
}