-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboard.cpp
More file actions
43 lines (37 loc) · 980 Bytes
/
board.cpp
File metadata and controls
43 lines (37 loc) · 980 Bytes
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
#include "board.h"
board::board(sf::Vector2f size, sf::Vector2f position, std::string src_img)
{
setPosition(position);
setSize(size);
_texture = new sf::Texture;
_texture->loadFromFile(src_img);
setTexture(_texture);
}
board::board(float size_x, float size_y, float x, float y, std::string src_img)
: board(sf::Vector2f(size_x, size_y), sf::Vector2f(x, y), src_img)
{
//Wywolanie przez liste wczesniejszego konstruktora
}
board::board(sf::Vector2f size, sf::Vector2f position, sf::Texture &src_tex)
{
setPosition(position);
setSize(size);
_texture = new sf::Texture;
_texture = &src_tex;
setTexture(_texture);
}
board::board(float size_x, float size_y, float x, float y, sf::Texture &src_tex)
: board(sf::Vector2f(size_x, size_y), sf::Vector2f(x, y), src_tex)
{
//Wywolanie przez liste wczesniejszego konstruktora
}
bool board::isContain(sf::Vector2f point)
{
if (getGlobalBounds().contains(point))
return true;
else
return false;
}
board::~board()
{
}