XNA Cards Games
I want to make a card game using C# and i found some APIs that give me access toward cards, but that APIs are for C++ that needed a wrapper. XNA framework have some way to access cards for a card game like cards.dll开发者_如何学Go?
The short answer is: no, there are no Card API for XNA. Unless my google-Fu is horrible.
I don't think it would be hard to roll your own. It is pretty basic. Only what you need is an Array of cards, each card with a value/color and position on the board. Flipped or not.
For cards display order, you can use the SpriteBatch Depth parameter so you don't have to worry about resorting your card array.
I would also suggest putting all cards graphic into a single texture sheet to avoid expensive texture switching in real time.
You might want to redefine your question. XNA should give you everything you need in terms of accessing the graphics cards for what XNA is. Is there something specific XNA isn't giving you that you'd want to do with native code?
It depends. If you want to make that game for the PC, then you can make use of a C++ unmanaged API dll. But if you want to make that game for either the Xbox 360 or Windows Phone 7, then you won't be able to.
精彩评论