示例#1
0
 /// <summary>
 /// [ボタン]の情報を一括取得
 /// </summary>
 public static XBStateButton GetStateButton(XBKeyCode.UserCode id)
 {
     XBStateButton sts = new XBStateButton();
     sts.A = XBGamePad.IsPressed(XBKeyCode.Button.A, id);
     sts.B = XBGamePad.IsPressed(XBKeyCode.Button.B, id);
     sts.X = XBGamePad.IsPressed(XBKeyCode.Button.X, id);
     sts.Y = XBGamePad.IsPressed(XBKeyCode.Button.Y, id);
     sts.start = XBGamePad.IsPressed(XBKeyCode.Button.Start, id);
     sts.back = XBGamePad.IsPressed(XBKeyCode.Button.Back, id);
     return sts;
 }
示例#2
0
        /// <summary>
        /// [右スティック]の情報を一括取得
        /// </summary>
        /// <param name="raw">未加工の値にするか?</param>
        public static XBStateAxis GetStateAxisR(XBKeyCode.UserCode id, bool raw = false)
        {
            XBStateAxis sts = new XBStateAxis();

            sts.stickPressed = XBGamePad.IsPressed(XBKeyCode.Button.RightStick, id);
            if (raw)
            {
                sts.axis = XBGamePad.GetAxisRaw(XBKeyCode.Axis.RightStick, id);
            }
            else
            {
                sts.axis = XBGamePad.GetAxis(XBKeyCode.Axis.RightStick, id);
            }

            return sts;
        }
示例#3
0
        /// <summary>
        /// [Shoulder & Trigger]の情報を一括取得
        /// </summary>
        /// <param name="raw">未加工の値にするか?</param>
        public static XBStateShoulder GetStateShoulder(XBKeyCode.UserCode id, bool raw = false)
        {
            XBStateShoulder sts = new XBStateShoulder();

            sts.shoulderL = XBGamePad.IsPressed(XBKeyCode.Button.LeftShoulder, id);
            sts.shoulderR = XBGamePad.IsPressed(XBKeyCode.Button.RightShoulder, id);

            if (raw)
            {
                sts.triggerL = XBGamePad.GetTriggerRaw(XBKeyCode.Trigger.LeftTrigger, id);
                sts.triggerR = XBGamePad.GetTriggerRaw(XBKeyCode.Trigger.RightTrigger, id);
            }
            else
            {
                sts.triggerL = XBGamePad.GetTrigger(XBKeyCode.Trigger.LeftTrigger, id);
                sts.triggerR = XBGamePad.GetTrigger(XBKeyCode.Trigger.RightTrigger, id);
            }

            return sts;
        }