当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - How does spriteBatch.DrawString draw text from compiled spritesheet texture?

问题描述:

Does each spriteBatch.DrawString(spriteFont, "text", new Vector2(10, 20), Color.White) call draw every letter of the text string separately (calls spriteBatch.Draw for each letter each frame), or does it make one texture and redraws it, or does it work in some other way?

网友答案:

It internally calls SpriteBatch.Draw() for each letter. then when you call SpriteBatch.End(), it hands the whole batch and any other Texture2D sprites you may have drawn since calling .Begin() to the GPU for rendering.

分享给朋友:
您可能感兴趣的文章:
随机阅读: