private SpriteRenderer(string name, Sprite sprite, string targetName = null) : base(name) { this.sprite = sprite; if (targetName == null) { batch = RenderManager.RegisterDrawCallback("UI", new RenderTargetBatch.DrawCallback(Draw)); } else { batch = RenderManager.RegisterDrawCallback(targetName, new RenderTargetBatch.DrawCallback(Draw)); } }
private TextRenderer(string name, Font font, string text, int size, string targetName = null) : base(name) { Text = text; Font = font; Size = size; Colour = Color.White; Position = Vector2.Zero; if (targetName == null) { batch = RenderManager.RegisterDrawCallback("UI", new RenderTargetBatch.DrawCallback(Draw)); } else { batch = RenderManager.RegisterDrawCallback(targetName, new RenderTargetBatch.DrawCallback(Draw)); } }
//make a new rendertargetbatch public static void AddRenderTargetBatch(RenderTargetBatch renderTargetBatch) { //add it to the list of batches instance.renderTargetBatches.Add(renderTargetBatch.Name, renderTargetBatch); }