开发者

Xna error - array of texture2d's

开发者 https://www.devze.com 2023-03-01 15:47 出处:网络
I have an array of Texture2D\'s set up like this; map = new Texture2D[30, 18]; H开发者_StackOverflow中文版owever, when I try and refer to map[30, 1] I get an index out of range of array error. Any

I have an array of Texture2D's set up like this;

map = new Texture2D[30, 18];

H开发者_StackOverflow中文版owever, when I try and refer to map[30, 1] I get an index out of range of array error. Any reason why this would be happening?

Thanks.


C# arrays are indexed from 0, so valid indices for an array of length 30 are 0 to 29.

0

精彩评论

暂无评论...
验证码 换一张
取 消