AddManuallyUpdated
Introduction
Code Example
int numberOfTexts = 1000;
for(int i = 0; i < numberOfTexts; i++)
{
var manuallyUpdatedText = new Text();
// Position the text randomly in view so all Text instances are
// scattered
Camera.Main.PositionRandomlyInView(manuallyUpdatedText, 40, 40);
// Shift to the left 150 pixels to make room for FPS display
manuallyUpdatedText.X -= 150;
// Set the DisplayText
manuallyUpdatedText.DisplayText = "Text " + i;
// Set the size of the text so it renders at pixel-perfect resolution
manuallyUpdatedText.SetPixelPerfectScale(Camera.Main);
// Add the text to the TextManager, using AddManuallyUpdated
// so that the text is only drawn, and not automatically updated
TextManager.AddManuallyUpdated(manuallyUpdatedText);
// Call ForceUpdateDependencies to apply all changes
// (such as position, size, and DisplayText) to the text
manuallyUpdatedText.ForceUpdateDependencies();
}
ForceUpdateDependencies
UpdateInternalRenderingVariables
Last updated
Was this helpful?