IdleState
⚠️ This class is for internal use only.
class IdleState extends State
A default state when there's no user input and no animation's playing
Properties
Methods
Properties
holding
Whether user is clicking or touching
Type: false
animating
Whether Flicking's animating
Type: false
delta
A sum of delta values of change events from the last hold event of Axes
Type: number
targetPanel
A panel to set as Control#activePanel after the animation is finished
Type: number
Methods
onEnter
An callback which is called when state has changed to this state
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
prevState | State | An previous state |
onHold
An event handler for Axes's hold event
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
ctx | object | ✔️ | Event context | |
ctx.flicking | Flicking | ✔️ | An instance of Flicking | |
ctx.axesEvent | object | ✔️ | A hold event of Axes | |
ctx.transitTo | function | ✔️ | A function for changing current state to other state |
onChange
An event handler for Axes's change event
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
ctx | object | ✔️ | Event context | |
ctx.flicking | Flicking | ✔️ | An instance of Flicking | |
ctx.axesEvent | object | ✔️ | A change event of Axes | |
ctx.transitTo | function | ✔️ | A function for changing current state to other state |
onRelease
An event handler for Axes's release event
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
ctx | object | ✔️ | Event context | |
ctx.flicking | Flicking | ✔️ | An instance of Flicking | |
ctx.axesEvent | object | ✔️ | A release event of Axes | |
ctx.transitTo | function | ✔️ | A function for changing current state to other state |
onAnimationEnd
An event handler for Axes's animationEnd event
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
ctx | object | ✔️ | Event context | |
ctx.flicking | Flicking | ✔️ | An instance of Flicking | |
ctx.axesEvent | object | ✔️ | A animationEnd event of Axes | |
ctx.transitTo | function | ✔️ | A function for changing current state to other state |
onFinish
An event handler for Axes's finish event
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
ctx | object | ✔️ | Event context | |
ctx.flicking | Flicking | ✔️ | An instance of Flicking | |
ctx.axesEvent | object | ✔️ | A finish event of Axes | |
ctx.transitTo | function | ✔️ | A function for changing current state to other state |