Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm currently using the Farseer tools to create a body from a Texture2D. However, my texture is a spritesheet and I need to get the uint array containing the colors from a portion of the full Texture2D.

Let's say may texture is 200x200 big and I need to get the colors in the Rectangle(20, 20, 40, 40). I know that there is a GetData() overload and I'd imagine I have to call it like this:

        uint[] subData = new uint[40 * 40];
        polygonTexture.GetData(0, new Rectangle(20, 20, 40, 40), subData, 0, 40*40);

However, I always get a "System.NotImplementedException", probably due to MonoGame. Is there another easy way to do this? Or do I have to create a Subtexture and then get the Colors from that subtexture?

Any help would be appreciated, thanks!

share|improve this question
2  
Ah, System.NotImplementedException. The classiest way of saying "couldn't be bothered". – Anko Apr 15 at 21:01
The best way would be to implement the missing functionality in MonoGame so the next person to try this won't get a NotImplementedException. Be bothered ;) – craftworkgames Apr 15 at 23:55
This doesn't sound too bad, actually, although I don't really know much about DirectX/OpenGL, but I'll look into it. – Bitbridge Apr 16 at 19:38

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.