Exemplo n.º 1
0
 /// <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();
 }
Exemplo n.º 2
0
 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); };
 }
Exemplo n.º 3
0
 /// <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();
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Adds the given state without adding it to the focus stack.
 /// </summary>
 public void AddState(State state)
 {
     states.AddBuffer.Add(state);
     toSort = true;
 }
Exemplo n.º 5
0
 /// <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;
 }
Exemplo n.º 6
0
 /// <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;
 }
Exemplo n.º 7
0
 /// <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();
     }
 }
Exemplo n.º 8
0
 public FadeTransition(Atom a, int layer, State nextState)
     : this(a, layer, 0.05f, false, nextState)
 {
 }