예제 #1
0
        protected override void Initialize()
        {
            base.Initialize();

            // Now assign these actions to our Input Handler
            InputHandler.AddCommand(new InputAction("Red", Buttons.A, Keys.F1));
            InputHandler.AddCommand(new InputAction("Green", Buttons.B, Keys.F2));
            InputHandler.AddCommand(new InputAction("Blue", Buttons.Y, Keys.F3));
        }
예제 #2
0
        public override void Register(IAddinHost host)
        {
            // copy host to local instance
            Host = host;

            // if we didn't find a control then create one
            if (host != null)
            {
                Trace.WriteLine(DateTime.Now + " | Editor Camera Addin Loaded .. ");

                // Create our Camera
                Camera          = new EditorCamera(Host.Game);
                Camera.Position = new Vector3(1, 20, 0);
                Camera.Pitch    = 0.5f;
                Camera.FarPlane = 3000;

                Host.Camera = Camera;

                // Retreive our Input Handler Service
                InputHandler = (InputHandler)Host.Game.Services.GetService(typeof(InputHandler));

                InputHandler.AddCommand(new InputAction("Left", Buttons.LeftStick, Keys.A));
                InputHandler.AddCommand(new InputAction("Right", Buttons.LeftStick, Keys.D));
                InputHandler.AddCommand(new InputAction("Forward", Buttons.LeftStick, Keys.W));
                InputHandler.AddCommand(new InputAction("Backward", Buttons.LeftStick, Keys.S));
                InputHandler.AddCommand(new InputAction("MoveUpward", Buttons.LeftStick, Keys.PageUp));
                InputHandler.AddCommand(new InputAction("MoveDownward", Buttons.LeftStick, Keys.PageDown));

                conSettings         = new conCameraSettings(Camera);
                conSettings.Enabled = false;

                Host.DockManager.SetDock(conSettings, DockPosition.Right);
            }
        }
예제 #3
0
        public void Test()
        {
            // Create our Camera
            Camera          = new BasicCamera(this);
            Camera.Position = new Vector3(0, 3, 25);
            Camera.Target   = new Vector3(0, 5, 0);
            Components.Add(Camera);

            Catapult = new Model(this, "Catapult1_rev2", Camera);
            Catapult.DiffuseColor = new Color(50, 50, 50, 255);
            Components.Add(Catapult);

            InputHandler.AddCommand(new InputAction("Left", Buttons.LeftStick, Keys.Left));
            InputHandler.AddCommand(new InputAction("Right", Buttons.RightStick, Keys.Right));
            InputHandler.AddCommand(new InputAction("Fire", Buttons.A, Keys.Space));

            Run();
        }
        public void Test()
        {
            IsMouseVisible = true;

            InputHandler.AddCommand(new InputAction("Forward", Buttons.LeftThumbstickUp, Keys.Up));
            InputHandler.AddCommand(new InputAction("Back", Buttons.LeftThumbstickUp, Keys.Down));
            InputHandler.AddCommand(new InputAction("Left", Buttons.LeftThumbstickUp, Keys.Left));
            InputHandler.AddCommand(new InputAction("Right", Buttons.LeftThumbstickUp, Keys.Right));
            InputHandler.AddCommand(new InputAction("bsIncrease", Buttons.LeftThumbstickUp, Keys.PageUp));
            InputHandler.AddCommand(new InputAction("bsDecrease", Buttons.LeftThumbstickUp, Keys.PageDown));
            InputHandler.AddCommand(new InputAction("Sculpting", Buttons.LeftThumbstickUp, Keys.F1));
            InputHandler.AddCommand(new InputAction("PaintLayer1", Buttons.LeftThumbstickUp, Keys.F2));
            InputHandler.AddCommand(new InputAction("PaintLayer2", Buttons.LeftThumbstickUp, Keys.F3));
            InputHandler.AddCommand(new InputAction("PaintLayer3", Buttons.LeftThumbstickUp, Keys.F4));
            InputHandler.AddCommand(new InputAction("PaintLayer4", Buttons.LeftThumbstickUp, Keys.F5));

            Camera          = new BasicCamera(this);
            Camera.Position = new Vector3(420, 100, 420);
            Camera.Target   = new Vector3(0, -50, 0);
            Components.Add(Camera);

            Run();
        }