2
かなり簡単。私は、 "Bananas"のような文字列をとり、SpriteFont
をたたき、SpriteBatch
のように画面に直接ではなくTexture2D
にレンダリングしたいと考えています。XNAで文字列をテクスチャに描画しますか?
できますか?別の方法として、ある種のFBO-esque機能と同様のことを達成できますか?
かなり簡単。私は、 "Bananas"のような文字列をとり、SpriteFont
をたたき、SpriteBatch
のように画面に直接ではなくTexture2D
にレンダリングしたいと考えています。XNAで文字列をテクスチャに描画しますか?
できますか?別の方法として、ある種のFBO-esque機能と同様のことを達成できますか?
RenderTarget2Dクラスを使用できます。 http://msdn.microsoft.com/en-us/library/bb198676.aspx このようなもの:
RenderTarget2D target = new RenderTarget2D(GraphicsDevice, width,height);
GraphicsDevice.SetRenderTarget(target);// Now the spriteBatch will render to the RenderTarget2D
spriteBatch.Begin();
spriteBatch.DrawString();//Do your stuff here
spriteBatch.End();
GraphicsDevice.SetRenderTarget(null);//This will set the spriteBatch to render to the screen again.
//If you are going to create the render target inside the Draw method, do this:
target.Dispose();
ブリリアント。どのように私はドキュメントで、おかげでそれを逃したか分からない。 – Cheezmeister