소스 검색

Add notes

customisations
alemart 8 달 전
부모
커밋
27b66d312c
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 2
    0
      docs/api/pointer-tracker.md
  2. 4
    4
      docs/api/trackable-pointer.md

+ 2
- 0
docs/api/pointer-tracker.md 파일 보기

52
     Pointers in adjusted space are contained in normalized space, but unless the viewport is a square, one of their coordinates, x or y, will no longer range from -1 to +1. It will range from *-s* to *+s*, where *s = min(a, 1/a)*. In this expression, *a* is the aspect ratio of the viewport and *s* is less than or equal to 1.
52
     Pointers in adjusted space are contained in normalized space, but unless the viewport is a square, one of their coordinates, x or y, will no longer range from -1 to +1. It will range from *-s* to *+s*, where *s = min(a, 1/a)*. In this expression, *a* is the aspect ratio of the viewport and *s* is less than or equal to 1.
53
 
53
 
54
     Selecting the adjusted space is useful for making sure that pointer speeds are equivalent in both axes and for preserving movement curves. Speeds are not equivalent and movement curves are not preserved by default because the normalized space is a square, whereas the viewport is a rectangle.
54
     Selecting the adjusted space is useful for making sure that pointer speeds are equivalent in both axes and for preserving movement curves. Speeds are not equivalent and movement curves are not preserved by default because the normalized space is a square, whereas the viewport is a rectangle.
55
+
56
+    In summary: prefer the adjusted space when tracking movements.

+ 4
- 4
docs/api/trackable-pointer.md 파일 보기

56
 
56
 
57
 `pointer.duration: number, read-only`
57
 `pointer.duration: number, read-only`
58
 
58
 
59
-The elapsed time, in seconds, since the tracking of this pointer began.
59
+The elapsed time, in seconds, since the tracking of this pointer began. You can check if this pointer represents a tap by comparing its duration to a threshold at the `"ended"` [phase](#phase). Example: `isTap = pointer.phase == "ended" && pointer.duration < 0.25`.
60
 
60
 
61
 ### movementLength
61
 ### movementLength
62
 
62
 
68
 
68
 
69
 `pointer.movementDuration: number, read-only`
69
 `pointer.movementDuration: number, read-only`
70
 
70
 
71
-The total time, in seconds, in which this pointer has moved. You can get the average speed of motion, excluding the times in which this pointer has not moved, by calculating the ratio `movementLength / movementDuration`.
71
+The total time, in seconds, in which this pointer has moved. You can get the average speed of motion, excluding the times in which this pointer remained stationary, by calculating the ratio `movementLength / movementDuration`.
72
 
72
 
73
 ### isPrimary
73
 ### isPrimary
74
 
74
 
75
 `pointer.isPrimary: boolean, read-only`
75
 `pointer.isPrimary: boolean, read-only`
76
 
76
 
77
-Whether or not this is the primary pointer among all pointers of this [type](#type). A typical primary pointer is that of a finger that touches the screen when no other fingers are touching it.
77
+Whether or not this is the primary pointer among all pointers of this [kind](#kind). A typical primary pointer is that of a finger that touches the screen when no other fingers are touching it.
78
 
78
 
79
 ### kind
79
 ### kind
80
 
80
 
81
 `pointer.kind: string, read-only`
81
 `pointer.kind: string, read-only`
82
 
82
 
83
-The type of device that originated this pointer. Typically `"touch"`, `"mouse"` or `"pen"`.
83
+The kind of device that originated this pointer. Typically `"touch"`, `"mouse"` or `"pen"`.

Loading…
취소
저장