I m starting out with xna, I m pretty newbie with this, but I m making my efforts to go on with this framework, anymay, my problem is:
that I have many .png images and dont want to make an object for any of those images so I want to put them up in a Texture2D
array, I thought that this is way to do it, but looks like it s not the correct way:
Texture2D[] _rCards, _bCards, _sCards;
_bCards = new Texture2D[9];
_rCards = new Texture2D[9];
_sCards = new Texture2D[6];
for (int i = 1; i < 10; i++)
{
_bCards[i] = Content.Load<Texture2D>("Images/Common/Black/"+i);
_rCards[i] = Content.Load<Texture2D>("Images/Common/Red/"+i);
if(i<6)
_sCards[i] = Content.Load<Texture2D>("Images/Special/Card" + (i-1));
}
纹理的文件名称为 1.png、 2.png、 3.png等等。
特殊卡片是卡片1png、卡片2png、卡片3png等。
我想做个21点的游戏
你能给我一个建议吗? 把所有这些纹理 装入一个单一的纹理2D阵列。
IDE 给出了一个无止境的专利问题 或什么的。
也许语言不理解 整个缩写 找到纹理作为字符串。