Skip to main content

LongPressGesture

Namespace:FairyGUI
Source:Assets/Scripts/Gesture/LongPressGesture.cs (line 10)

public class LongPressGesture : EventDispatcher

长按手势。当按下一定时间后(duration),派发onAction,如果once为false,则间隔duration时间持续派发onAction,直到手指释放。

Inheritance:EventDispatcher → LongPressGesture

Inherited members​

EventDispatcher

AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching

Constructors​

LongPressGesture(GObject)​

public LongPressGesture(GObject host);
ParameterTypeDescription
hostGObject

Source:Gesture/LongPressGesture.cs (line 57)

Fields​

INTERVAL​

public static float INTERVAL;

Source:Gesture/LongPressGesture.cs (line 55)

TRIGGER​

public static float TRIGGER;

Source:Gesture/LongPressGesture.cs (line 54)

holdRangeRadius​

public int holdRangeRadius;

手指按住后,移动超出此半径范围则手势停止。

Source:Gesture/LongPressGesture.cs (line 48)

interval​

public float interval;

派发onAction事件的时间间隔。单位秒。

Source:Gesture/LongPressGesture.cs (line 38)

once​

public bool once;

如果为真,则onAction再一次按下释放过程只派发一次。如果为假,则每隔duration时间派发一次。

Source:Gesture/LongPressGesture.cs (line 43)

trigger​

public float trigger;

第一次派发事件的触发时间。单位秒

Source:Gesture/LongPressGesture.cs (line 33)

Methods​

Cancel()​

public void Cancel();

Source:Gesture/LongPressGesture.cs (line 107)

Dispose()​

public void Dispose();

Source:Gesture/LongPressGesture.cs (line 70)

Enable(bool)​

public void Enable(bool value);
ParameterTypeDescription
valuebool

Source:Gesture/LongPressGesture.cs (line 76)

Properties​

host​

public GObject host { get; private set; }

Source:Gesture/LongPressGesture.cs (line 15)

onAction​

public EventListener onAction { get; private set; }

当手指按下后一段时间后派发该事件。并且在手指离开前按一定周期派发该事件。

Source:Gesture/LongPressGesture.cs (line 28)

onBegin​

public EventListener onBegin { get; private set; }

当手指按下时派发该事件。

Source:Gesture/LongPressGesture.cs (line 20)

onEnd​

public EventListener onEnd { get; private set; }

手指离开屏幕时派发该事件。

Source:Gesture/LongPressGesture.cs (line 24)