What i'm trying to do is check perfect-pixel colision with 2 textures which have black edges for example: one of this texture is a circle the second one can be triangle or rectangle.
this my code which give me only array of color without coordinates which i need
Color[] playerColorArray = new Color[texturePlayer.Width * texturePlayer.Height];
Color[] secondColorArray = new Color[secondTexture.Width * sencondTexture.Height];
texturePlayer.GetData(playerColorArray);
secondTexture.GetData(secondTextureArray);
and my question is how to get coordinates from Texture2D for each pixel which are Black in this Texture2D.
thanks for advance:)
You already have array of colors, so only one you need is to determinate coordinate in 2D of each from pixels in your arrays.
in Riemers tutorial (which I recommend), it's done like that:
Color[,] colors2D = new Color[texture.Width, texture.Height];
for (int x = 0; x < texture.Width; x++)
{
for (int y = 0; y < texture.Height; y++)
{
colors2D[x, y] = colors1D[x + y * texture.Width];
}
}