예제 #1
0
        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));
            }
        }
예제 #2
0
        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));
            }
        }
예제 #3
0
 //make a new rendertargetbatch
 public static void AddRenderTargetBatch(RenderTargetBatch renderTargetBatch)
 {
     //add it to the list of batches
     instance.renderTargetBatches.Add(renderTargetBatch.Name, renderTargetBatch);
 }