Exemplo n.º 1
0
        /// <summary>
        /// Sets the npc's image when you click the button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NPCImageButton_Click(object sender, RoutedEventArgs e)
        {
            string aux = openFileManager.SetLabelImageFromFile(NPCImageLabel);

            if (aux != null)
            {
                image = aux;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the stage's background when you click the button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StageBackgroundImageButton_Click(object sender, RoutedEventArgs e)
        {
            string aux = openFileManager.SetLabelImageFromFile(StageBackgroundImageLabel);

            try
            {
                if (aux != null)
                {
                    BitmapImage bmi = new BitmapImage(new Uri(aux));

                    if (bmi.Height > 380 || bmi.Width > 640)
                    {
                        StageBackgroundImageLabel.Content = null;
                        throw new Exception();
                    }

                    image = aux;
                }
            }

            catch (Exception)
            {
                MessageBox.Show("You cannot load an image bigger than 640x380", "Attention", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets the up attack image of the character when you click the button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CharacterAttackingUpButton_Click(object sender, RoutedEventArgs e)
        {
            string aux = openFileManager.SetLabelImageFromFile(CharacterAttackingUpLabel);

            if (aux != null)
            {
                imageAttackingUp = aux;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the up moving image of the enemy when you click the button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EnemyMovingUpButton_Click(object sender, RoutedEventArgs e)
        {
            string aux = openFileManager.SetLabelImageFromFile(EnemyMovingUpLabel);

            if (aux != null)
            {
                imageMovingUp = aux;
            }
        }