Is it possible to get the pixel at x and y of a sprite? Or does this method only work for sf::Images?
And is it somehow possible to set a rect for a texture? I made the collision layer as sf::image and check
if (pImage.getPixel(x + 4+(2*i) ,y + 30 -(j*2)).a > 0)
{
answer = true;
return answer;
}
when x and y are the player coordinates but this is a bit cpu intensiv, i would like to make the image smaller with a Rect so its only as big as needed to check if a player is on a non transparent place. This would work with a Sprite but i cant get the PixelColor if i use Sprite