Beispiel #1
0
 private void AllFramesDirty(Animation ani)
 {
     if (ani != null)
     {
         ani.AllFramesDirty();
     }
 }
Beispiel #2
0
        private void DisplayAnimation(Animation ani)
        {
            timer1.Stop();
            _currentAnimation = ani;
            _currentAnimation.AllFramesDirty();

            ddbID.Text = _currentAnimation.ID.ToString();
            
            txtAnimationFrames.Text = _currentAnimation.FrameCount.ToString();

            // muss vor DisplayFrame gesetzt werden, sonst evtl Überlauf
            _updateSliderEventDisable = true;
            tbFramePosition.Value = 0;
            _updateSliderEventDisable = false;
            tbFramePosition.Maximum = _currentAnimation.FrameCount - 1;

            if (_currentAnimation.Frames.Count > 0)
            {
                if (_currentAnimation.LastSelectedFrame != null)
                {
                    DisplayFrame(_currentAnimation.LastSelectedFrame);
                }
                else
                {
                    DisplayFrame(_currentAnimation.Frames[0]);
                }
            }
            else
            {
                _currentFrame = null;
            }

            // muss nach DisplayFrame gesetzt werden, sonst mehrfaches BuildImage durch ValueChange-Ereignisse
            udAnimationPositionX.Value = _currentAnimation.PositionX;
            udAnimationPositionY.Value = _currentAnimation.PositionY;
            udAnimationDelay.Value = _currentAnimation.Delay;
        }