【漢化】Swipe Input

Swipe Input

Swipe Input

This is a Plugin that allows the developer to check for swipe input on the
touch screen or on a mouse.

這個插件可以讓開發(fā)者檢測玩家的滑動信息久窟,例如觸屏滑動或者鼠標(biāo)滑動

How to Use

The main purpose of this Plugin is to help make Timed Attacks usable on
mobile devices. However, this Plugin can allow for other functions.

這個插件的命令是為了協(xié)助即時戰(zhàn)斗系統(tǒng)趟章,當(dāng)然也附帶其他很多功能

In order to use, one must use one of the following code:

你需要使用下面的命令來激活

SwipeInput.isTriggered(direction)
SwipeInput.isPressed(direction)

These are the two main functions that can be used in the Script section
of a conditional branch, or through some other boolean-releated code.

這段命令可以檢測玩家的滑動方向并觸發(fā)

SwipeInput.isTriggered

The first function is:

SwipeInput.isTriggered(direction)

This function only returns true on the exact frame a swipe is completed.
This should be primailty used for code/events that should only occur
once per swipe.

第一個命令可以檢測某方向滑動是否完成乃秀,通常用來執(zhí)行滑動完的事件等

It needs at least one Parameter, which is the direction of the swipe that
is being checked:

他需要一個方向作為參數(shù)

SwipeInput.isTriggered(‘up’)
SwipeInput.isTriggered(‘right’)
SwipeInput.isTriggered(‘left’)
SwipeInput.isTriggered(‘down’)

However, there are two other optional Parameters:

當(dāng)然你還有其他額外的參數(shù)可以選擇

SwipeInput.isTriggered(‘direction’, MinimumDistance, MaximumTime)

Minimum Distance is the minimum amount of distance the swipe needs to be
to be registered as a swipe.

滑動最小距離

Maximum Time is the maximum amount of time the swipe can go on for before
no longer being registered as a swipe command.

滑動最長時間

The defaults for both Minimum Distance and Maximum Time can be customized
in the Parameters of this plugin.

你可以在插件參數(shù)里面設(shè)置默認值,或使用下面代碼

Examples:

SwipeInput.isTriggered(‘up’, 30, 9999)
SwipeInput.isTriggered(‘down’, 50)
SwipeInput.isTriggered(‘left’, 100, 500)

SwipeInput.isPressed

This is the same as SwipeInput.isTriggered, only this will constantly
return true as long as a swipe has been completed and the touch is still
being held down.

這個和上個命令類似,但是將會監(jiān)測滑動過程

SwipeInput.isPressed(‘up’)
SwipeInput.isPressed(‘right’)
SwipeInput.isPressed(‘left’)
SwipeInput.isPressed(‘down’)

The first mandatory Parameter is still the same and requires a direction.

這段命令也必須要存在一個方向作為參數(shù)

SwipeInput.isTriggered(‘direction’, MinimumDistance, MinimumTime)

However, the third Parameter has been changed. As can be seen here, it has
been switched to Minimum Time. This refers the minimum amount of time a
touch input has to be pressed before it can start to be registered as a
swipe input.

這里也有兩個可選參數(shù)邀层,最小距離以及最少時間微饥,最少時間指的是滑動持續(xù)的最小時間

Examples:

SwipeInput.isPressed(‘right’, 50, 0)
SwipeInput.isPressed(‘left’, 100)
SwipeInput.isPressed(‘up’, 30, 10)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市乒融,隨后出現(xiàn)的幾起案子掰盘,更是在濱河造成了極大的恐慌,老刑警劉巖赞季,帶你破解...
    沈念sama閱讀 217,185評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件愧捕,死亡現(xiàn)場離奇詭異,居然都是意外死亡申钩,警方通過查閱死者的電腦和手機次绘,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,652評論 3 393
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來撒遣,“玉大人邮偎,你說我怎么就攤上這事∫謇瑁” “怎么了禾进?”我有些...
    開封第一講書人閱讀 163,524評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長廉涕。 經(jīng)常有香客問我泻云,道長艇拍,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,339評論 1 293
  • 正文 為了忘掉前任宠纯,我火速辦了婚禮卸夕,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘征椒。我一直安慰自己娇哆,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 67,387評論 6 391
  • 文/花漫 我一把揭開白布勃救。 她就那樣靜靜地躺著碍讨,像睡著了一般。 火紅的嫁衣襯著肌膚如雪蒙秒。 梳的紋絲不亂的頭發(fā)上勃黍,一...
    開封第一講書人閱讀 51,287評論 1 301
  • 那天,我揣著相機與錄音晕讲,去河邊找鬼覆获。 笑死,一個胖子當(dāng)著我的面吹牛瓢省,可吹牛的內(nèi)容都是我干的弄息。 我是一名探鬼主播,決...
    沈念sama閱讀 40,130評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼勤婚,長吁一口氣:“原來是場噩夢啊……” “哼摹量!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起馒胆,我...
    開封第一講書人閱讀 38,985評論 0 275
  • 序言:老撾萬榮一對情侶失蹤缨称,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后祝迂,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體睦尽,經(jīng)...
    沈念sama閱讀 45,420評論 1 313
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,617評論 3 334
  • 正文 我和宋清朗相戀三年型雳,在試婚紗的時候發(fā)現(xiàn)自己被綠了当凡。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,779評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡四啰,死狀恐怖宁玫,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情柑晒,我是刑警寧澤欧瘪,帶...
    沈念sama閱讀 35,477評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站匙赞,受9級特大地震影響佛掖,放射性物質(zhì)發(fā)生泄漏妖碉。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,088評論 3 328
  • 文/蒙蒙 一芥被、第九天 我趴在偏房一處隱蔽的房頂上張望欧宜。 院中可真熱鬧,春花似錦拴魄、人聲如沸冗茸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,716評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽夏漱。三九已至,卻和暖如春顶捷,著一層夾襖步出監(jiān)牢的瞬間挂绰,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,857評論 1 269
  • 我被黑心中介騙來泰國打工服赎, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留葵蒂,地道東北人。 一個月前我還...
    沈念sama閱讀 47,876評論 2 370
  • 正文 我出身青樓重虑,卻偏偏與公主長得像践付,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子缺厉,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,700評論 2 354

推薦閱讀更多精彩內(nèi)容