-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApps.h
48 lines (38 loc) · 1.29 KB
/
Apps.h
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
37
38
39
40
41
42
43
44
45
46
47
48
//
// Created by Kelly Lwin on 4/23/2023.
//
#ifndef SFML_TEMPLATE_APPS_H
#define SFML_TEMPLATE_APPS_H
#include <iostream>
#include <SFML/Graphics.hpp>
#include "Icon.h"
#include "Font.h"
#include "MouseEvents.h"
#include "App_Window.h"
class Apps: public sf::Drawable {
private:
sf::Texture texture;
sf::Sprite icon;
std::string appName;
sf::Text appName_;
sf::Font font;
void appNameSetup(const std::string& name);
void iconSetup(const IconEnum& iconEnum);
void defaultSetup(const std::string& name, const IconEnum& iconEnum);
public:
App_Window appWindow;
bool appRunning = false;
Apps(): Apps("", COMPUTER) {}; //default constructor
explicit Apps(const std::string& appName, const IconEnum& iconEnum);
void setAppName(const std::string& name);
void setAppIcon(const IconEnum& iconEnum);
sf::Vector2f getPosition() const;
void setPosition(const sf::Vector2f& pos);
void setWindowPosition(const sf::Vector2f& pos);
void addEventHandler(sf::RenderWindow& window, sf::Event);
void addEventHandler(sf::RenderWindow& window, sf::Event, void (*f)());
void update();
protected:
void draw(sf::RenderTarget &target, sf::RenderStates states) const override;
};
#endif //SFML_TEMPLATE_APPS_H