private void on_mouse_leave(object sender, MouseEventArgs e) { if (!Enabled) { return; } UserControlAnimation.FadeInElement(glowPath, false); }
private void on_mouse_enter(object sender, MouseEventArgs e) { if (!Enabled || Selected) { return; } UserControlAnimation.FadeInElement(glowPath, true); //added sound effect for the button VolumeManager.play(@"Resources/Audio/UserControlButtonHover.wav"); }
private void Position_MouseLeave(object sender, MouseEventArgs e) { if (!humanTurn) { return; } Move move = findMoveFromPosition(sender); if (validMove(move) || PlayerTwo is HardAiPlayer) { FrameworkElement element = sender as FrameworkElement; UserControlAnimation.FadeInElement(element, false); } }
private void on_player_moved(object gameengine, PlayerMoveEventArgs eventargs) { BoardState state = eventargs.State; Move move = eventargs.Move; Dispatcher.Invoke(() => { playedMoves.Add(move); int row = move.Row; int col = move.Col; UserControlAnimation.FadeInElement(inactiveImages[row, col], false); if (activeImages[row, col] != null) { Sprite previousSprite = activeImages[row, col] as Sprite; if (previousSprite != null) { previousSprite.Opacity = 0; originalPossibleMoveSprite.RemoveDependent(previousSprite); } } activeImages[row, col] = addPod(state[move], inactiveImages[row, col], move); int redScore, blackScore; eventargs.Board.GetScore(state, out redScore, out blackScore); //change the score labels HumanPodsLabel.Content = state.RedMovesLeft; RobotPodsLabel.Content = state.BlackMovesLeft; HumanScoreLabel.Content = redScore; RobotScoreLabel.Content = blackScore; }); }
private static void FadeOutControl(ContentControl control) { UserControlAnimation.FadeOutContentControl(control); //set the Content control to the back }
private static void FadeInControl(ContentControl control, int index) { // Bring the control up front UserControlAnimation.FadeInContentControl(control); }