mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2024-12-02 03:56:51 -05:00
Update README for recent changes in API
This commit is contained in:
parent
4d1e467b2d
commit
d33c6764b6
1 changed files with 20 additions and 3 deletions
|
@ -41,10 +41,26 @@ And I hope people to become giving some real feedback at least.
|
||||||
|
|
||||||
h3. Getting Started
|
h3. Getting Started
|
||||||
|
|
||||||
Like so:
|
All gestures dispatch (if you listen) GestureEvent with the next types:
|
||||||
|
GestureEvent.GESTURE_STATE_CHANGE
|
||||||
|
GestureEvent.GESTURE_IDLE
|
||||||
|
GestureEvent.GESTURE_POSSIBLE
|
||||||
|
GestureEvent.GESTURE_FAILED
|
||||||
|
|
||||||
|
Discrete gestures also dispatch:
|
||||||
|
GestureEvent.GESTURE_RECOGNIZED
|
||||||
|
|
||||||
|
Continuous gestures also dispatch:
|
||||||
|
GestureEvent.GESTURE_BEGAN
|
||||||
|
GestureEvent.GESTURE_CHANGED
|
||||||
|
GestureEvent.GESTURE_ENDED
|
||||||
|
|
||||||
|
If you use a good IDE (such as Intellij IDEA, FDT, FlashDevelop, Flash Builder) you should see these events in autocompletion.
|
||||||
|
|
||||||
|
Quick start:
|
||||||
<pre><code>var doubleTap:TapGesture = new TapGesture(myButton);
|
<pre><code>var doubleTap:TapGesture = new TapGesture(myButton);
|
||||||
doubleTap.numTapsRequired = 2;
|
doubleTap.numTapsRequired = 2;
|
||||||
doubleTap.addEventListener(TapGestureEvent.GESTURE_TAP, onDoubleTap);
|
doubleTap.addEventListener(GestureEvent.GESTURE_RECOGNIZED, onDoubleTap);
|
||||||
...
|
...
|
||||||
private function onDoubleTap(event:TapGestureEvent):void
|
private function onDoubleTap(event:TapGestureEvent):void
|
||||||
{
|
{
|
||||||
|
@ -53,7 +69,8 @@ private function onDoubleTap(event:TapGestureEvent):void
|
||||||
</code></pre>
|
</code></pre>
|
||||||
or
|
or
|
||||||
<pre><code>var freeTransform:TransformGesture = new TransformGesture(myImage);
|
<pre><code>var freeTransform:TransformGesture = new TransformGesture(myImage);
|
||||||
freeTransform.addEventListener(TransformGestureEvent.GESTURE_TRANSFORM, onFreeTransform);
|
freeTransform.addEventListener(GestureEvent.GESTURE_BEGAN, onFreeTransform);
|
||||||
|
freeTransform.addEventListener(GestureEvent.GESTURE_CHANGED, onFreeTransform);
|
||||||
...
|
...
|
||||||
private function onFreeTransform(event:TransformGestureEvent):void
|
private function onFreeTransform(event:TransformGestureEvent):void
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue