예제 #1
0
 public GraphNode()
 {
     graph = new LineGraphDouble()
     {
         GraphArea = new RectF(100, 100, 760, 520),
         LabelFont = Font.LoadDynamicFontStrict("Resources/GenYoMinJP-Bold.ttf", 30),
         LabelX    = "Generation",
         LabelY    = "Lives",
         MaxX      = 1,
         MaxY      = 10,
         Size      = new Vector2F(960, 720),
         ValueFont = Font.LoadDynamicFontStrict("Resources/GenYoMinJP-Bold.ttf", 30)
     };
     AddChildNode(graph);
     rawData         = graph.AddData(Array.Empty <Vector2F>());
     rawData.Color   = new Color(100, 255, 100);
     substruct       = graph.AddData(Array.Empty <Vector2F>());
     substruct.Color = new Color(255, 100, 100);
     InitTool();
 }
예제 #2
0
        public void TestDouble()
        {
            Engine.Initialize("Test", 960, 720);
            var graph = new LineGraphDouble()
            {
                AxisColor  = new Color(0, 0, 0),
                BackColor  = new Color(255, 255, 255),
                GraphArea  = new RectF(100, 50, 450, 450),
                LabelColor = new Color(0, 0, 0),
                LabelFont  = Font.LoadDynamicFontStrict("Resources/GenYoMinJP-Bold.ttf", 30),
                MaxX       = 20f,
                MaxY       = 20f,
                MinX       = 0f,
                MinY       = 0f,
                Size       = new Vector2F(600, 600),
                ValueColor = new Color(0, 0, 0),
                ValueFont  = Font.LoadDynamicFontStrict("Resources/GenYoMinJP-Bold.ttf", 30)
            };

            Engine.AddNode(graph);
            //var source = new Vector2F[20];
            //for (int i = 0; i < source.Length; i++) source[i] = new Vector2F(i * 2, i * i);
            //graph.MaxX = System.Linq.Enumerable.Max(source, x => x.X);
            //graph.MaxY = System.Linq.Enumerable.Max(source, x => x.Y);
            //graph.MinX = System.Linq.Enumerable.Min(source, x => x.X);
            //graph.MinY = System.Linq.Enumerable.Min(source, x => x.Y);
            //graph.AddData(source, new Color(255, 100, 100), 3f);
            graph.AddData(new[] { new Vector2F(15f, 0f), new Vector2F(14f, 4f), new Vector2F(12f, 7f), new Vector2F(10f, 10f), new Vector2F(7f, 12f), new Vector2F(4f, 14f), new Vector2F(0, 15f) }, new Color(255, 100, 100), 3f);
            while (Engine.DoEvents())
            {
                if (Engine.Keyboard.GetKeyState(Key.S) == ButtonState.Push)
                {
                    Engine.Graphics.SaveScreenshot($"SS/{nameof(TestDouble)}.png");
                }
                Engine.Update();
            }
            Engine.Terminate();
        }