quartersForRelease関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What letting go makes of a dragged layer: the quarter turns it snaps to, from −2 to 2, where 0 is back where it was and no move at all.
Short of the point of no return (commitAngle) it goes back; from there up
to the same distance past a quarter turn it is one quarter turn; further
is a half turn. A flick, still moving fast the way it was dragged, makes
the quarter turn from short of the point. speed is in degrees a
millisecond, signed like the angle.
インポート
import { quartersForRelease } from "@johnmorrisdotca/kyuubu";
定義
function quartersForRelease(angle: number, speed?: number, commitAngle?: number): -2 | -1 | 0 | 1 | 2
引数
| 名前 | 型 | 説明 |
|---|---|---|
angle | number | The signed drag angle in degrees. |
speed (省略可) | number | The signed drag speed in degrees per millisecond. |
commitAngle (省略可) | number | The drag angle in degrees at which a resting release commits a turn. |
戻り値
0 | 1 | -1 | 2 | -2
What letting go makes of a dragged layer: the quarter turns it snaps to, from −2 to 2, where 0 is back where it was and no move at all. Short of the point of no return (commitAngle) it goes back; from there up to the same distance past a quarter turn it is one quarter turn; further is a half turn. A flick, still moving fast the way it was dragged, makes the quarter turn from short of the point. speed is in degrees a millisecond, signed like the angle.
例
import { quartersForRelease } from "@johnmorrisdotca/kyuubu";
console.log(quartersForRelease(60, 0));1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。