static void Main(string[] args)
        {
            string hostname = "10.10.0.32:1234";

            if (args.Length > 0)
            {
                hostname = args[0];
            }


            Application.Init();
            var top = Application.Top;

            top.Add(log      = new LogWindow());
            top.Add(status   = new StatusWindow());
            top.Add(controls = new ControlsWindow());



            var menu = new MenuBar(new MenuBarItem[] {
                new MenuBarItem("_File", new MenuItem [] {
                    new MenuItem("_New", "", null),
                    new MenuItem("_Close", "", null),
                    new MenuItem("_Quit", "", null)
                }),
                new MenuBarItem("_Edit", new MenuItem [] {
                    new MenuItem("_Copy", "", null),
                    new MenuItem("C_ut", "", null),
                    new MenuItem("_Paste", "", null)
                })
            });

            top.Add(menu);

            androidConnection = new AndroidConnector(hostname);
            using (scanner = new Scanner())
            {
                Task.Run(RunScanner);
                Application.Run();
            }
        }
Example #2
0
        static void Input()
        {
            float dx = 0, dy = 0;

            if (Keyboard.IsKeyPressed(Keyboard.Key.W))
            {
                dx = 0;
                dy = -1;
                ApplyAdditionalMoveModifeirs(dx, dy);
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.A))
            {
                dx = -1;
                dy = 0;
                ApplyAdditionalMoveModifeirs(dx, dy);
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.S))
            {
                dx = 0;
                dy = 1;
                ApplyAdditionalMoveModifeirs(dx, dy);
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.D))
            {
                dx = 1;
                dy = 0;
                ApplyAdditionalMoveModifeirs(dx, dy);
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.X))
            {
                R++;
                Vector2f pos = circle.Position;
                circle          = new CircleShape(R);
                circle.Position = pos;
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.Z))
            {
                R--;
                Vector2f pos = circle.Position;
                circle          = new CircleShape(R);
                circle.Position = pos;
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.Escape))
            {
                window.Close();
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.H))
            {
                text();
                while (IsHelpWindowOpen())
                {
                    if (Keyboard.IsKeyPressed(Keyboard.Key.Enter))
                    {
                        ControlsWindow.Close();
                    }
                }
            }
            if (Keyboard.IsKeyPressed(Keyboard.Key.F))
            {
                window.Close();
                Render();
            }

            NewColor();
        }