-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDialogSystem.hpp
More file actions
36 lines (32 loc) · 1.13 KB
/
DialogSystem.hpp
File metadata and controls
36 lines (32 loc) · 1.13 KB
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
35
36
//
// Created by Fabien on 30/12/2016.
//
#ifndef SWRPG_DIALOGSYSTEM_HPP
#define SWRPG_DIALOGSYSTEM_HPP
#include "Imports.hpp"
#include "Components.hpp"
class DialogSystem : public entityx::System<DialogSystem>, public entityx::Receiver<DialogSystem>
{
public:
DialogSystem(sf::RenderTarget& pTarget):mTarget(pTarget),mDialog({1024,300}), mShowDialog(false)
{
mDialogFont.loadFromFile("font.ttf");
mDialog.setPosition({0,768-300});
mDialog.setFillColor({0,0,0,128});
const sf::Vector2f &position = mDialog.getPosition();
mDialogText.setPosition(position.x, position.y);
mDialogText.setFont(mDialogFont);
mDialogText.setCharacterSize(40);
mDialogText.setFillColor({255,255,255,255});
}
void receive(const DialogEvent& dialogEvent);
void configure(entityx::EventManager &event_manager);
void update(entityx::EntityManager &es, entityx::EventManager &events, entityx::TimeDelta dt);
private:
sf::RenderTarget& mTarget;
sf::RectangleShape mDialog;
sf::Text mDialogText;
sf::Font mDialogFont;
bool mShowDialog;
};
#endif //SWRPG_DIALOGSYSTEM_HPP_HPP