示例#1
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;
        }
示例#2
0
        /// <summary>
        /// [十字キー]の情報を一括取得
        /// </summary>
        /// <param name="raw">未加工の値にするか?</param>
        public static XBStateDPad GetStateDPad(XBKeyCode.UserCode id, bool raw = false)
        {
            XBStateDPad sts = new XBStateDPad();

            if (raw)
            {
                sts.axis = XBGamePad.GetAxisRaw(XBKeyCode.Axis.Dpad, id);
            }
            else
            {
                sts.axis = XBGamePad.GetAxis(XBKeyCode.Axis.Dpad, id);
            }

            sts.left = (sts.axis.x < 0);
            sts.right = (sts.axis.x > 0);
            sts.up = (sts.axis.y > 0);
            sts.down = (sts.axis.y < 0);

            return sts;
        }