/// <summary> /// Adds the given state to the top of the focus stack. /// </summary> public void AddFocus(State state) { if (focusState.Count > 0) GetFocusedState().OnBlur(); focusState.Add(state); state.OnFocus(); }
public FadeTransition(Atom a, int layer, float animationSpeed, bool skipFadeOut, State nextState) : base(a, layer) { this.animationSpeed = animationSpeed; this.skipFadeOut = skipFadeOut; this.midAction = delegate() { a.stateManager.AddState(nextState); }; this.endAction = delegate() { a.stateManager.AddFocus(nextState); }; }
/// <summary> /// Puts the given state on the top of the focus stack and removes all previous copies of the state from lower levels. /// If this state does not exist in the focus stack it will still be added to the top. /// </summary> public void BringToFront(State state) { State cur = GetFocusedState(); focusState.RemoveAll(i => i == state); focusState.Add(state); if (GetFocusedState() != cur) { GetFocusedState().OnBlur(); state.OnFocus(); } }
/// <summary> /// Adds the given state without adding it to the focus stack. /// </summary> public void AddState(State state) { states.AddBuffer.Add(state); toSort = true; }
/// <summary> /// Adds the state and adds it to the top of the focus stack. /// </summary> public void StartState(State state) { states.AddBuffer.Add(state); AddFocus(state); toSort = true; }
/// <summary> /// Removes the given state and removes all instances of it from the focus stack. /// </summary> /// <param name="state"></param> public void EndState(State state) { states.RemoveBuffer.Add(state); State cur = GetFocusedState(); focusState.RemoveAll(i => i == state); if (GetFocusedState() != cur && GetFocusedState() != null) { state.OnBlur(); GetFocusedState().OnFocus(); } toSort = true; }
/// <summary> /// Removes the given state from the focus stack. /// </summary> public void DropFocus(State state) { State cur = GetFocusedState(); focusState.Remove(state); if (GetFocusedState() != cur && GetFocusedState() != null) { state.OnBlur(); if (focusState.Count > 0) GetFocusedState().OnFocus(); } }
public FadeTransition(Atom a, int layer, State nextState) : this(a, layer, 0.05f, false, nextState) { }