Exemplo n.º 1
0
        public void Update()
        {
            if (playerTransform == null) // No camera yet
            {
                return;
            }
            RenderContract[] renderBuf = goManager.GetRenderers();
            UIRenderStruct   uiRender  = uiManager.GetRenderer();

            ClearWindow();
            // Draw game
            foreach (RenderContract rC in renderBuf)
            {
                Transform  t = rC.Transform;
                RenderComp r = rC.Render;

                int finalX = (int)t.Position.X - (int)playerTransform.Position.X + (60 / 2);
                int finalY = (int)t.Position.Y - (int)playerTransform.Position.Y + (26 / 2);

                if (finalY < 26 && finalX < 60)
                {
                    consoleWindow.Write(finalY, finalX, r.Char, r.Foreground, r.Background);
                }
            }

            // Draw UI on top
            consoleWindow.Write((int)uiRender.Pos.Y, (int)uiRender.Pos.X, uiRender.Text, Color4.White);

            consoleWindow.WindowUpdate();
        }
Exemplo n.º 2
0
 public RenderContract(Transform t, RenderComp r)
 {
     Transform = t;
     Render    = r;
 }