如何从其他几个小型Textures2D中创建一个大的Texture2D?然后显示该图像而不是所有小图像。
答案 0 :(得分:0)
您可以使用RenderTarget2D
_renderTarget = new RenderTarget2D(GraphicsDevice, (int)size.X, (int)size.Y);
GraphicsDevice.SetRenderTarget(_renderTarget);
GraphicsDevice.Clear(Color.Transparent);
SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque);
//draw some stuff.
SpriteBatch.End()
GraphicsDevice.SetRenderTarget(null);
GraphicsDevice.Clear(Color.Blue);
SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque);
SpriteBatch.Draw(_renderTarget, Vector2.Zero, Color.white);
SpriteBatch.End()