Page MenuHomePhabricator (Chris)

boardelem.cpp
No OneTemporary

Authored By
Unknown
Size
1 KB
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);
// rectangle.setOutlineThickness(0.5);
return rectangle;
}
}
efc::BoardElem::BoardElem(TextureHolder *textures,int pos, int type)
{
textureTiles = &textures->textureTiles;
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);
setTexture(textures->textureTiles);
setTextureRect(sf::IntRect(x_type*efc::TILE_SIZE, y_type*efc::TILE_SIZE, efc::TILE_SIZE, efc::TILE_SIZE));
// Sprite::SetBlendMode(sf::BlendMode::BlendAdd);
}

File Metadata

Mime Type
text/x-c++
Expires
Sun, Nov 15, 3:03 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124561
Default Alt Text
boardelem.cpp (1 KB)

Event Timeline