예제 #1
0
        public override void Draw(Canvas2D canvas, float dt)
        {
            canvas.Begin(left_view);
            canvas.DrawQuad(in bg_quad, bg_tile);
            canvas.DrawQuad(in quad, texture);
            canvas.End();

            canvas.Begin(right_view);
            canvas.DrawQuad(in bg_quad, bg_tile);
            canvas.DrawQuad(in quad, texture);
            canvas.End();
        }
예제 #2
0
        public override void Draw(Canvas2D canvas, float dt)
        {
            canvas.Begin(m_render_target_view);

            m_sprite.Draw(canvas);

            canvas.End();

            canvas.Begin();

            m_sprite_target.Draw(canvas);

            m_sprite.Draw(canvas);

            canvas.End();
        }
예제 #3
0
        public override void Draw(Canvas2D canvas, float dt)
        {
            canvas.Begin();

            canvas.DrawTriangle(vertices[0], vertices[1], vertices[2]);

            canvas.End();
        }
예제 #4
0
        public override void Draw(Canvas2D canvas, float dt)
        {
            canvas.Begin();

            canvas.DrawQuad(in quad);

            canvas.End();
        }
예제 #5
0
        public override void Draw(Canvas2D canvas, float dt)
        {
            canvas.Begin();

            sprite.Draw(canvas);
            character.Draw(canvas);

            canvas.End();
        }
예제 #6
0
        public override void Draw(Canvas2D canvas, float dt)
        {
            canvas.Begin();

            canvas.DrawString("HELLO WORLD ! hello world ! 0123456789", new Vec2(0, 0), Color.Green);
            canvas.DrawString("This is OMEGA ENGINE", new Vec2(5, 15), Color.White);
            canvas.DrawString($"Draw Calls: {Engine.Canvas.MaxDrawCalls}", new Vec2(5, 25), Color.OrangeRed);

            canvas.End();
        }
예제 #7
0
        public void Draw(Canvas2D canvas)
        {
            if (_refresh)
            {
                Console.WriteLine("Redraw Gui");

                Blitter.Begin(_surface);

                Blitter.Clear();

                _root.Draw(Drawer);

                if (DebugMode)
                {
                    Blitter.DrawText(10, 10, $"Hovered: {HoveredWidget?.Id ?? "None"}");
                    Blitter.DrawText(10, 35, $"Active: {ActiveWidget?.Id ?? "None"}");
                    Blitter.DrawText(10, 65, $"Input Focused: {InputFocusedWidget?.Id ?? "None"}");

                    //for (int i = 0; i < _widgets.Count; ++i)
                    //{
                    //    var w = _widgets[i];
                    //    blitter.Text(10, 50 + (i) * 10, $"{w.Id} [ZIndex: {w.ZIndex}]", 1);
                    //}
                }

                Blitter.End();

                _refresh = false;
            }



            canvas.Begin();

            canvas.DrawQuad(in _quad, _surface);

            canvas.End();
        }
예제 #8
0
 public override void Draw(Canvas2D canvas, float dt)
 {
     canvas.Begin();
     _surface.Draw(canvas);
     canvas.End();
 }