Exemple #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();
}
Exemple #2
0
Vector2f RenderTarget::mapPixelToCoords(const Vector2i& point) const
{
    return mapPixelToCoords(point, getView());
}
Exemple #3
0
sf::Vector2f Window::getMousePositionView(sf::View const& view)
{
    return mapPixelToCoords(sf::Mouse::getPosition(*this),view);
}
Exemple #4
0
sf::Vector2f Window::getMousePositionMap()
{
    return mapPixelToCoords(sf::Mouse::getPosition(*this));
}
Exemple #5
0
sf::Vector2f Window::getTouchPositionView(sf::View const& view, unsigned int touchIndex)
{
    return mapPixelToCoords(sf::Touch::getPosition(touchIndex,*this),view);
}
Exemple #6
0
sf::Vector2f Window::getTouchPositionMap(unsigned int touchIndex) const
{
    return mapPixelToCoords(sf::Touch::getPosition(touchIndex,*this));
}