Appearance
Class: Ticker
刷新器
Hierarchy
EventEmitter
↳
Ticker
Table of contents
Constructors
Properties
Accessors
Methods
- addListener
- destroy
- emit
- eventNames
- listenerCount
- listeners
- off
- on
- once
- removeAllListeners
- removeListener
- start
- stop
- update
Constructors
constructor
• new Ticker()
Inherited from
EE.constructor
Properties
_stepTime
• _stepTime: number
Defined in
animationFrame
• animationFrame: number
Defined in
deltaTime
• deltaTime: number
= 1
上一帧和当前帧间隔时间 ms
Defined in
fillTime
• fillTime: number
= 0
需要填补的时间
Defined in
lastFrameTime
• lastFrameTime: number
= 0
上一次屏幕刷新的时间
Defined in
lastTime
• lastTime: number
= 0
记录上一帧的时间
Defined in
paused
• paused: boolean
= false
Defined in
prefixed
▪ Static
prefixed: string
| boolean
Inherited from
EE.prefixed
Defined in
node_modules/eventemitter3/index.d.ts:9
Accessors
FPS
• get
FPS(): number
每秒帧数
最大帧数不会超过浏览器刷新率
默认每秒60帧
Returns
number
Defined in
• set
FPS(val
): void
Parameters
Name | Type |
---|---|
val | number |
Returns
void
Defined in
Methods
addListener
▸ addListener<T
>(event
, fn
, context?
): Ticker
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn | (...args : any []) => void |
context? | any |
Returns
Inherited from
EE.addListener
Defined in
node_modules/eventemitter3/index.d.ts:45
destroy
▸ destroy(): void
销毁
Returns
void
Defined in
emit
▸ emit<T
>(event
, ...args
): boolean
Calls each of the listeners registered for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
...args | any [] |
Returns
boolean
Inherited from
EE.emit
Defined in
node_modules/eventemitter3/index.d.ts:32
eventNames
▸ eventNames(): (string
| symbol
)[]
Return an array listing the events for which the emitter has registered
listeners.
Returns
(string
| symbol
)[]
Inherited from
EE.eventNames
Defined in
node_modules/eventemitter3/index.d.ts:15
listenerCount
▸ listenerCount(event
): number
Return the number of listeners listening to a given event.
Parameters
Name | Type |
---|---|
event | string | symbol |
Returns
number
Inherited from
EE.listenerCount
Defined in
node_modules/eventemitter3/index.d.ts:27
listeners
▸ listeners<T
>(event
): (...args
: any
[]) => void
[]
Return the listeners registered for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
Returns
(...args
: any
[]) => void
[]
Inherited from
EE.listeners
Defined in
node_modules/eventemitter3/index.d.ts:20
off
▸ off<T
>(event
, fn?
, context?
, once?
): Ticker
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn? | (...args : any []) => void |
context? | any |
once? | boolean |
Returns
Inherited from
EE.off
Defined in
node_modules/eventemitter3/index.d.ts:69
on
▸ on<T
>(event
, fn
, context?
): Ticker
Add a listener for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn | (...args : any []) => void |
context? | any |
Returns
Inherited from
EE.on
Defined in
node_modules/eventemitter3/index.d.ts:40
once
▸ once<T
>(event
, fn
, context?
): Ticker
Add a one-time listener for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn | (...args : any []) => void |
context? | any |
Returns
Inherited from
EE.once
Defined in
node_modules/eventemitter3/index.d.ts:54
removeAllListeners
▸ removeAllListeners(event?
): Ticker
Remove all listeners, or those of the specified event.
Parameters
Name | Type |
---|---|
event? | string | symbol |
Returns
Inherited from
EE.removeAllListeners
Defined in
node_modules/eventemitter3/index.d.ts:79
removeListener
▸ removeListener<T
>(event
, fn?
, context?
, once?
): Ticker
Remove the listeners of a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn? | (...args : any []) => void |
context? | any |
once? | boolean |
Returns
Inherited from
EE.removeListener
Defined in
node_modules/eventemitter3/index.d.ts:63
start
▸ start(): void
开始
Returns
void
Defined in
stop
▸ stop(): void
暂停
Returns
void
Defined in
update
▸ update(time
): void
每次刷新要执行的内容
Parameters
Name | Type |
---|---|
time | number |
Returns
void