How to use the @egjs/axes.DIRECTION_HORIZONTAL function in @egjs/axes

To help you get started, we’ve selected a few @egjs/axes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github naver / egjs-view360 / src / YawPitchControl / input / RotationPanInput.js View on Github external
getOffset(properties, useDirection) {
		if (this._useRotation === false) {
			return super.getOffset(properties, useDirection);
		}

		const offset = super.getOffset(properties, [true, true]);
		const newOffset = [0, 0];
		const theta = this._screenRotationAngle.getRadian();
		const cosTheta = Math.cos(theta);
		const sinTheta = Math.sin(theta);

		newOffset[0] = offset[0] * cosTheta - offset[1] * sinTheta;
		newOffset[1] = offset[1] * cosTheta + offset[0] * sinTheta;

		// Use only user allowed direction.
		if (!(this._userDirection & Axes.DIRECTION_HORIZONTAL)) {
			newOffset[0] = 0;
		} else if (!(this._userDirection & Axes.DIRECTION_VERTICAL)) {
			newOffset[1] = 0;
		}

		return newOffset;
	}
github naver / egjs-flicking / dist / flicking.esm.js View on Github external
}(Mixin(Component)["with"](eventHandler));

  Flicking.utils = utils;
  Flicking.VERSION = "2.5.1";
  Flicking.consts = {
    EVENTS: EVENTS,
    TRANSFORM: TRANSFORM,
    SUPPORT_WILLCHANGE: SUPPORT_WILLCHANGE,
    IS_ANDROID2: IS_ANDROID2
  };
  Flicking.DIRECTION_NONE = Axes.DIRECTION_NONE;
  Flicking.DIRECTION_LEFT = Axes.DIRECTION_LEFT;
  Flicking.DIRECTION_RIGHT = Axes.DIRECTION_RIGHT;
  Flicking.DIRECTION_UP = Axes.DIRECTION_UP;
  Flicking.DIRECTION_DOWN = Axes.DIRECTION_DOWN;
  Flicking.DIRECTION_HORIZONTAL = Axes.DIRECTION_HORIZONTAL;
  Flicking.DIRECTION_VERTICAL = Axes.DIRECTION_VERTICAL;
  Flicking.DIRECTION_ALL = Axes.DIRECTION_ALL;
  return Flicking;
}();
github naver / egjs-flicking / src / Flicking.js View on Github external
* @type {Number}
	 * @default 16
	 */
	static DIRECTION_DOWN = Axes.DIRECTION_DOWN;

	/**
	 * Constant value for horizontal direction.
	 * @ko horizontal 방향에 대한 상수 값.
	 * @name DIRECTION_HORIZONTAL
	 * @memberof eg.Flicking
	 * @static
	 * @constant
	 * @type {Number}
	 * @default 6
	 */
	static DIRECTION_HORIZONTAL = Axes.DIRECTION_HORIZONTAL;

	/**
	 * Constant value for vertical direction.
	 * @ko vertical 방향에 대한 상수 값.
	 * @name DIRECTION_VERTICAL
	 * @memberof eg.Flicking
	 * @static
	 * @constant
	 * @type {Number}
	 * @default 24
	 */
	static DIRECTION_VERTICAL = Axes.DIRECTION_VERTICAL;

	/**
	 * Constant value for all direction.
	 * @ko all 방향에 대한 상수 값.

@egjs/axes

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.

MIT
Latest version published 3 months ago

Package Health Score

75 / 100
Full package analysis

Similar packages