public void Initialize(DeviceComponent model)
        {
            _model = model as JoystickDeviceComponent;

            if (_model == null)
                throw new ApplicationException();

            lblName.Text = _model.Name;
        }
Ejemplo n.º 2
0
        public GamePadDevice()
        {
            _buttonA = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "A" };
            _buttonB = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "B" };
            _buttonX = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "X" };
            _buttonY = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Y" };
            _buttonUp = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Up" };
            _buttonDown = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Down" };
            _buttonLeft = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Left" };
            _buttonRight = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Right" };
            _buttonLeftShoulder = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Left Shoulder" };
            _buttonRightShoulder = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Right Shoulder" };
            _buttonLeftStick = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Left Stick" };
            _buttonRightStick = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Right Stick" };
            _buttonBack = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Back" };
            _buttonStart = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Start" };
            _buttonCenter = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Center" };

            _leftStick = new JoystickDeviceComponent(this) { XAxis = 0.0f, YAxis = 0.0f, Name = "Left Analog" };
            _rightStick = new JoystickDeviceComponent(this) { XAxis = 0.0f, YAxis = 0.0f, Name = "Right Analog" };

            _leftTrigger = new TriggerDeviceComponent(this) { Name = "Left Trigger" };
            _rightTrigger = new TriggerDeviceComponent(this) { Name = "Right Trigger" };
        }
Ejemplo n.º 3
0
        private Boolean JoystickChanged(Vector2 joystickState, JoystickDeviceComponent joystick)
        {
            if (joystickState.X != joystick.XAxis)
                return true;

            if (joystickState.Y != joystick.YAxis)
                return true;

            return false;
        }