【 OnPluginTick 】
說明:
This is called 25 times a second (every 40 milliseconds), even if
timers are disabled.
It is intended as a simple way of doing things that need to be done
smoothly and more rapidly than timers allow (timer granularity is set to
a minimum of 1/10 of a second). For example, when using the sound
functions such as PlaySound, you could smoothly fade music up or down
using this callback.
Also you might use it to implement scrolling text (eg. a miniwindow
that says "Critical Hit!") which smoothly scrolls up the screen and
disappears. The callback is called 25 times a second as 25 fps (frames
per second) is about the minimum for smooth animation, so animated
effects (like scrolling text) should look reasonably smooth if
implemented using this.
Warning! This is implemented using a Windows timer event (WM_TIMER).
This is a low-priority event, which means it may not be called if other
things are happening. In other words, the timer may fire less frequently
than 25 times a second, depending on what else is happening.
即使定時器被關閉,也能呼叫它在一秒執行 25 次內容(每 40 毫秒)。
它的目的是用一個簡單的方法來做事情,需要做得比定時器所能的更順利、迅
速,(定時器精度設定最小為 1/10 秒) 。 PlaySound的功能,如使用的聲音時
,例如,可以順利地褪色音樂或向下使用此回調。
此外,你可能會用它來實現滾動文字內容(如:一個 miniwindow 說:“關鍵
命中!”)順暢地在螢幕上向上滾動並消失*。這回傳一秒被呼叫 25 次,因為動
畫最低流暢張數為 25 FPS (每秒張數)。如果用這個,動畫效果(如:滾動文字
內容)看起來理論上應該會流暢地實現。
注意!為實現這個使用了系統的定時器事件(WM_TIMER)。這是一個處理順序
低的事件,這意味著:若有其他的事件正發生,它未必會被呼叫。換句話說,定時
器發動的頻率每秒可能低於 25 次,這取決於正發生什麼事。
*指瀏覽一個文章時,向下滾動滑鼠讓文章的內容往上滑動直至文末。
*第一段我也不知道在翻什麼啦!
範例:
function OnPluginTick ()
自訂內容
end
--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--