Exemplo n.º 1
0
void Level::destroyEntity(Entity& e)
{
    const sf::Vector2i coord = mapPixelToCoords(entities.getComponent<CompSkin>(e.id())->_sprite.getPosition());

    _entitiesLayer->remove(&e,false);

    _byCoords[coord].remove(&e);
    e.remove();
}
Exemplo n.º 2
0
Vector2f RenderTarget::mapPixelToCoords(const Vector2i& point) const
{
    return mapPixelToCoords(point, getView());
}
Exemplo n.º 3
0
sf::Vector2f Window::getMousePositionView(sf::View const& view)
{
    return mapPixelToCoords(sf::Mouse::getPosition(*this),view);
}
Exemplo n.º 4
0
sf::Vector2f Window::getMousePositionMap()
{
    return mapPixelToCoords(sf::Mouse::getPosition(*this));
}
Exemplo n.º 5
0
sf::Vector2f Window::getTouchPositionView(sf::View const& view, unsigned int touchIndex)
{
    return mapPixelToCoords(sf::Touch::getPosition(touchIndex,*this),view);
}
Exemplo n.º 6
0
sf::Vector2f Window::getTouchPositionMap(unsigned int touchIndex) const
{
    return mapPixelToCoords(sf::Touch::getPosition(touchIndex,*this));
}