State Events

  1. Events.StateWillSwitch — About to switch to a new state. 译:动画事件的快捷键

  2. Events.StateDidSwitch — Just switched to new state. 译:就切换到新的状态。

layerA = new Layer

layerA.states.add
    rotate:
        rotation: 90

layerA.states.switch("rotate")

# Returns the old state, new state and layer.states 
layerA.on Events.StateDidSwitch, (from, to, states) ->
    print from, to, states

State Event Shortcuts
译:状态事件的快捷键

# For Events.StateWillSwitch 
layerA.onStateWillSwitch ->
    print "Will switch state"

# For Events.StateDidSwitch 
layerA.onStateDidSwitch ->
    print "Did switch state"

results matching ""

    No results matching ""