layer.states.next(states)

Switches to the next state. If we reach the end of the states we start at the beginning again. You can provide an array of state names for the ordering. If you don't provide an array with state names it will use the ordering by when a state got added.
译:切换到下一个状态。如果我们到达了结束的状态,我们开始再次开始。您可以为排序提供一个状态名称数组。如果你不提供一个数组的状态名称,它将使用的顺序时,一个状态增加了。

Arguments(参数)

states — One or multiple strings. 译:一个或多个字符串。

layerA = new Layer

layerA.states.add
    stateA:
        x: 500
        opacity: 0.5

    stateB:
        x: 200
        opacity: 1

# Every time we call this we cycle through the states 
layerA.states.next("stateA", "stateB")

results matching ""

    No results matching ""