示例#1
0
 void TileIsoHexa::setPosition(const int& X,const int& Y)
 {
     sf::Vector2f pos(mapCoordsToPixel(X,Y));
     shape.setPosition(pos);
     if(sprite)
         sprite->setPosition(pos);
 };
示例#2
0
 sf::IntRect SquareIso::getTextureRect(int x,int y,float scale)
 {
     sf::Vector2f pos = mapCoordsToPixel(x,y,scale);
     sf::IntRect res(pos.x,
                   pos.y,
                   width * scale,
                   height * scale);
     return res;
 }
示例#3
0
Vector2i RenderTarget::mapCoordsToPixel(const Vector2f& point) const
{
    return mapCoordsToPixel(point, getView());
}
示例#4
0
文件: Window.cpp 项目: Cmdu76/Rucks
void Window::setMousePositionView(sf::Vector2f pos, sf::View const& view)
{
    sf::Mouse::setPosition(mapCoordsToPixel(pos,view));
}
示例#5
0
文件: Window.cpp 项目: Cmdu76/Rucks
void Window::setMousePositionMap(sf::Vector2f pos)
{
    sf::Mouse::setPosition(mapCoordsToPixel(pos));
}
示例#6
0
 sf::Vector2f TileIsoHexa::mapCoordsToPixel(const sf::Vector2i& pos)
 {
     return mapCoordsToPixel(pos.x,pos.y);
 }