public static void RemoveText(Text textToRemove) { #if DEBUG if (!FlatRedBallServices.IsThreadPrimary()) { throw new InvalidOperationException("Objects can only be added on the primary thread"); } #endif if (textToRemove == null) { return; } textToRemove.ClearRelationships(); textToRemove.RemoveSelfFromListsBelongingTo(); //This is to clean up the Sprite from the engine and // unloads its texture if (textToRemove.RenderOnTexture) { textToRemove.RenderOnTexture = false; } }