Closed miaowm5 closed 8 years ago
'in frames'的含义应该是'以帧为单位'吧(如果能测试一下此函数的效果就能确定了)
按键间隔时间,in frames,帧之间,感觉这样比较合适
一个是 interval ,一个是 wait time ,两个都是处理按键间隔的,怎么区分开来 @winkidney
求一下上下文:)
in frames: 以帧为单位
我觉得你这个短语就理解错了吧- -
The wait time of the key repeat in frames. 多少帧后开始算作重复按键。
The interval of the key repeat in frames. 每两次重复按键之间间隔多少帧。
…………两种说法之间有什么区别
@taroxd
keyRepeatWait = 24, keyRepeatInterval = 6 的话
按住一个键的第 1 帧,第 24 帧,第 30 帧,第 36 帧,... 会判定 isRepeated 返回 true。
我表达能力也有限,你自己表达一下这个意思吧
是两次按键的间隔吧?比如keyRepeatInterval = 6 ,那么6帧之内的两次按键会被认为是重复按键?
wait time是这次重复可以在接下来多少帧被检测到? 这个API我不太熟,不知道有源码可以看没
果然还是得回去看源代码……
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 };
原来是用来判定新追加的长按功能的 =口=
repeat的含义要弄清楚。实际的repeat并不是指多次按下按键。而是指按住按键不放的时候,间隔多少帧就算重复按下。如果使用press则反应时间太短,如果使用trigger则只有一次有效果。@winkidney
@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这两个数
赞
@miaowm5 长按功能哪里是新追加的…… VA 里的 Input.repeat? 不就是吗?
Input.isLongPressed Input.isRepeated @taroxd
哦 了解。但没啥影响
keyRepeatInterval The interval of the key repeat in frames. 重复按键的判定间隔帧数
keyRepeatWait The wait time of the key repeat in frames. 按键长按的判定间隔帧数。
喵的感觉还是不会翻啊
keyRepeatWait 并不只是长按里用到啊,isRepeated 里面也用到了
keyRepeatInterval 进入重复按键(长按)状态之后,两次重复按键之间间隔的帧数
keyRepeatWait 开始进入重复按键(长按)状态之前等待的帧数
喵的感觉还是不会翻啊 喵的谁会去改这俩数啊 喵的还好我没入坑F1的翻译
keyRepeatInterval The interval of the key repeat in frames. 重复按键的判定间隔帧数
keyRepeatWait The wait time of the key repeat in frames. 一次按键的持续时间
…………这不是和原版意思完全反过来了吗
keyRepeatInterval 重复按键的判定间隔帧数(isRepeated,isLongPressed触发的间隔帧数)
keyRepeatWait isLongPressed触发最小持续帧数
喵的感觉还是不会翻啊 喵的谁会去改这俩数啊
第一个是触发间隔,第二个是按键持续时间检测
所以大概后面那个翻译成 一次按键的持续时间 应该最准确了?
一次按键的持续时间 不就是1帧吗 歧义很大的(
例子在这条 https://github.com/miaowm5/RMMV-F1/issues/25#issuecomment-150883118 里
@taroxd 不是吧?只是每帧推送这个事件,然后每帧都按了,就叫做持续按键吧?
是的,一般你也不会松开按键后下一帧立刻再按上去……
一次按下按键的持续时间?
keyRepeatWait = 24, keyRepeatInterval = 6 的话
按住一个键的第 1 帧,第 24 帧,第 30 帧,第 36 帧,... 会判定 isRepeated 返回 true。 按住一个键的第 1 帧,第 24 帧,第 25 帧,第 26 帧,... 会判定 isLongPressed 返回 true。
进入长按状态前的等待时间 我觉得这个挺准确啊
keyRepeatInterval 重复按键状态更新间隔时间(帧) keyRepeatWait 进入长按状态前的等待时间(帧)
好的,不管了 没异议就用最后这个了 ˋ△ˊ
The interval of the key repeat in frames. (待议)重复按键在一帧中的持续时间。
The wait time of the key repeat in frames. (待议)重复按键在一帧中的等待时间。
虽然能够理解意思,但是却不知道怎么翻译成中文比较合适……