I'm currently working on a project in XNA, Visual Studio, where it is crucial I can create the classic tetris figures solely based on one square sprite (So I can return to each individual square at a later point, as I need individual squares highlighted at another point in the game).
I tried loading my square into my code, then use a matrix(Texture2D 2d-array) to draw one of my pieces:
centerPiece = new Texture2D[,] { { null, Content.Load<Texture2D>("square"), null }, { Content.Load<Texture2D>("square"), Content.Load<Texture2D>("square"), Content.Load<Texture2D>("square") }, { null, Content.Load<Texture2D>("square"), null } };
At first glance it seemed fine, but when I try to actually draw it using this method:
spriteBatch.Draw(centerPiece[,], screenView(), null, Color.White, 0f, IMGCenter(), 1f, SpriteEffects.None, 0f);
It can't draw it as an 2D array, or normal array for that matter. Neither is it able to draw the "nulls" I use in my first method, which also denies me of drawing it by the use of a nested for loop.
Am I completely on the wrong track, or am I just missing a slight detail?
Texture2D
in the array during the Draw(). You can't draw an array. \$\endgroup\$