Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

03_04.html(Input Class) #25

Closed
miaowm5 opened this issue Oct 24, 2015 · 31 comments
Closed

03_04.html(Input Class) #25

miaowm5 opened this issue Oct 24, 2015 · 31 comments
Labels

Comments

@miaowm5
Copy link
Owner

miaowm5 commented Oct 24, 2015

The interval of the key repeat in frames.
(待议)重复按键在一帧中的持续时间。

The wait time of the key repeat in frames.
(待议)重复按键在一帧中的等待时间。

虽然能够理解意思,但是却不知道怎么翻译成中文比较合适……

@RyanBernX
Copy link
Contributor

'in frames'的含义应该是'以帧为单位'吧(如果能测试一下此函数的效果就能确定了)

@winkidney
Copy link
Contributor

按键间隔时间,in frames,帧之间,感觉这样比较合适

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

一个是 interval ,一个是 wait time ,两个都是处理按键间隔的,怎么区分开来
@winkidney

@winkidney
Copy link
Contributor

求一下上下文:)

@taroxd
Copy link

taroxd commented Oct 25, 2015

in frames: 以帧为单位

我觉得你这个短语就理解错了吧- -

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

@taroxd
Copy link

taroxd commented Oct 25, 2015

The wait time of the key repeat in frames.
多少帧后开始算作重复按键。

The interval of the key repeat in frames.
每两次重复按键之间间隔多少帧。

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

…………两种说法之间有什么区别

@taroxd

@taroxd
Copy link

taroxd commented Oct 25, 2015

keyRepeatWait = 24, keyRepeatInterval = 6 的话

按住一个键的第 1 帧,第 24 帧,第 30 帧,第 36 帧,... 会判定 isRepeated 返回 true。

我表达能力也有限,你自己表达一下这个意思吧

@winkidney
Copy link
Contributor

是两次按键的间隔吧?比如keyRepeatInterval = 6 ,那么6帧之内的两次按键会被认为是重复按键?

@winkidney
Copy link
Contributor

wait time是这次重复可以在接下来多少帧被检测到?
这个API我不太熟,不知道有源码可以看没

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

果然还是得回去看源代码……

TouchInput.isRepeated = function() {
return (this.isPressed() && (this._triggered || (this._pressedTime >= this.keyRepeatWait && this._pressedTime % this.keyRepeatInterval === 0)))
};
TouchInput.isLongPressed = function() {
return this.isPressed() && this._pressedTime >= this.keyRepeatWait
};

原来是用来判定新追加的长按功能的 =口=

@RyanBernX
Copy link
Contributor

repeat的含义要弄清楚。实际的repeat并不是指多次按下按键。而是指按住按键不放的时候,间隔多少帧就算重复按下。如果使用press则反应时间太短,如果使用trigger则只有一次有效果。@winkidney

@taroxd
Copy link

taroxd commented Oct 25, 2015

@winkidney 有源码 在 rpg_core.js 里面

这个不是检测重复按键的,而是把长按按键当做重复的。就和 VA 的 Input.repeat? 一样

而且我自己也实现过,知道那个 6 和 24 是什么意思:http://taroxd.github.io/rgss/%E5%85%A8%E9%94%AE%E7%9B%98%E8%84%9A%E6%9C%AC.html (就是下面那个 self.repeat? 里的 6 和 23。其中大于号改成大于等于就是 24 了)

不要问我为什么我会知道是6和24这两个数

@winkidney
Copy link
Contributor

@taroxd
Copy link

taroxd commented Oct 25, 2015

@miaowm5 长按功能哪里是新追加的…… VA 里的 Input.repeat? 不就是吗?

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

Input.isLongPressed
Input.isRepeated
@taroxd

@taroxd
Copy link

taroxd commented Oct 25, 2015

哦 了解。但没啥影响

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

keyRepeatInterval
The interval of the key repeat in frames.
重复按键的判定间隔帧数

keyRepeatWait
The wait time of the key repeat in frames.
按键长按的判定间隔帧数。

喵的感觉还是不会翻啊

@taroxd
Copy link

taroxd commented Oct 25, 2015

keyRepeatWait 并不只是长按里用到啊,isRepeated 里面也用到了

@taroxd
Copy link

taroxd commented Oct 25, 2015

keyRepeatInterval
进入重复按键(长按)状态之后,两次重复按键之间间隔的帧数

keyRepeatWait
开始进入重复按键(长按)状态之前等待的帧数

喵的感觉还是不会翻啊 喵的谁会去改这俩数啊 喵的还好我没入坑F1的翻译

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

keyRepeatInterval
The interval of the key repeat in frames.
重复按键的判定间隔帧数

keyRepeatWait
The wait time of the key repeat in frames.
一次按键的持续时间

…………这不是和原版意思完全反过来了吗

@winkidney
Copy link
Contributor

keyRepeatInterval
重复按键的判定间隔帧数(isRepeated,isLongPressed触发的间隔帧数)

keyRepeatWait
isLongPressed触发最小持续帧数

喵的感觉还是不会翻啊 喵的谁会去改这俩数啊

@winkidney
Copy link
Contributor

第一个是触发间隔,第二个是按键持续时间检测

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

所以大概后面那个翻译成 一次按键的持续时间 应该最准确了?

@taroxd
Copy link

taroxd commented Oct 25, 2015

一次按键的持续时间 不就是1帧吗 歧义很大的(

例子在这条 #25 (comment)

@winkidney
Copy link
Contributor

@taroxd 不是吧?只是每帧推送这个事件,然后每帧都按了,就叫做持续按键吧?

@taroxd
Copy link

taroxd commented Oct 25, 2015

是的,一般你也不会松开按键后下一帧立刻再按上去……

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

一次按下按键的持续时间?

@taroxd
Copy link

taroxd commented Oct 25, 2015

keyRepeatWait = 24, keyRepeatInterval = 6 的话

按住一个键的第 1 帧,第 24 帧,第 30 帧,第 36 帧,... 会判定 isRepeated 返回 true。
按住一个键的第 1 帧,第 24 帧,第 25 帧,第 26 帧,... 会判定 isLongPressed 返回 true。

@taroxd
Copy link

taroxd commented Oct 25, 2015

进入长按状态前的等待时间 我觉得这个挺准确啊

@winkidney
Copy link
Contributor

keyRepeatInterval
重复按键状态更新间隔时间(帧)
keyRepeatWait
进入长按状态前的等待时间(帧)

@miaowm5
Copy link
Owner Author

miaowm5 commented Oct 25, 2015

好的,不管了
没异议就用最后这个了
ˋ△ˊ

miaowm5 added a commit that referenced this issue Oct 25, 2015
@miaowm5 miaowm5 closed this as completed Oct 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants