Page MenuHomePhabricator (Chris)

boardelem.cpp
No OneTemporary

Authored By
Unknown
Size
881 B
Referenced Files
None
Subscribers
None

boardelem.cpp

#include "boardelem.h"
namespace efc {
sf::RectangleShape createNeighbour(int pos) {
sf::RectangleShape rectangle(sf::Vector2f(efc::TILE_SIZE, efc::TILE_SIZE));
sf::Vector2i cords(efc::transPosition(pos));
rectangle.setFillColor(sf::Color(240, 240, 240,98));
rectangle.setOutlineColor(sf::Color(24,24,24, 90));
rectangle.setPosition(cords.x*efc::TILE_SIZE, cords.y*efc::TILE_SIZE);
return rectangle;
}
}
efc::BoardElem::BoardElem(int pos, int type)
{
this->pos = pos;
this->type = type;
sf::Vector2i cords = efc::transPosition(pos);
int y_type = (int) type / efc::TILE_BOARD_SIZE;
int x_type = type % efc::TILE_BOARD_SIZE;
setPosition(cords.x*efc::TILE_SIZE,cords.y*efc::TILE_SIZE);
setTextureRect(sf::IntRect(x_type*efc::TILE_SIZE, y_type*efc::TILE_SIZE, efc::TILE_SIZE, efc::TILE_SIZE));
textureTiles = nullptr;
}

File Metadata

Mime Type
text/x-c++
Expires
Sat, Aug 15, 10:49 PM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
77334
Default Alt Text
boardelem.cpp (881 B)

Event Timeline