I have a tile set that contains 3 32x32 tiles i am attempting to load the tile set into a Texture2D and then i am trying to draw each tile onto another Texture2D after that i add the new Texture2D containing one tile to a array list.
When i draw back my image stored in my array list i get nothing on the screen.
I know I am doing this wrong could anyone shed some light on the problem?
here is my a code snippet
Texture2D tempTileSet = Content.Load<Texture2D>("testMegaman1");
Texture2D tempTex = new Texture2D(graphics.GraphicsDevice, 32, 32);
SpriteBatch sb = new SpriteBatch(tempTex.GraphicsDevice);
sb.Begin();
sb.Draw(tempTileSet, new Vector2(0, 0), new Rectangle(0, 0, TILE_SIZE_X, TILE_SIZE_Y), Color.White);
sb.End();
tempTex.GraphicsDevice.Clear(Color.Black);
tileSet.Add(tempTex);
I am aware that this is inefficient but it makes it easy for me to draw a map. I don't need to store the whole map image...
Wait a second... Would it be more efficient to have a raw image (png) of the map and then just draw the onscreen section?
It sounds more efficient basing that information what iv read online.
But what do i do about an animated map? do i have a separate map image for each frame of the background animation?
This post has been edited by giuseppe105: 23 December 2011 - 09:47 AM

New Topic/Question
Reply



MultiQuote





|