Пример #1
0
        private void DrawBlazingEffect(double gameTime)
        {
            var anyBlazer = (from e in Parent.Players where e.IsBlazing select e).Any();

            if (!anyBlazer)
            {
                return;
            }

            gameTime *= 4;
            var beatFraction = gameTime - Math.Floor(gameTime);

            beatFraction = 1 - beatFraction;
            var opacity = (byte)(beatFraction * 255);

            _blazingPart.ColorShading.A = opacity;

            _blazingPart.Draw();
            _blazingSidePart.ColorShading   = Color.White;
            _blazingSidePart.ColorShading.A = opacity;

            for (int x = 0; x < 4; x++)
            {
                if (!Parent.Players[x].IsBlazing)
                {
                    continue;
                }
                _blazingSidePart.Position = SidePositions[x];
                _blazingSidePart.Draw();
            }

            _blazingMiddlePart.ColorShading.A = opacity;
            _blazingMiddlePart.Draw();
        }
Пример #2
0
 private void DrawFullEffect()
 {
     if (!Parent.LifebarFull(PlayerID) || (Parent.Players[PlayerID].IsBlazing))
     {
         return;
     }
     _blazingPart.ColorShading   = _fullColors[PlayerID];
     _blazingPart.ColorShading.A = 128;
     _blazingPart.Draw();
 }
Пример #3
0
        public override void Draw()
        {
            var myPosition = this.Position.Clone();

            DrawEnteredTextBar(myPosition.Clone());
            myPosition.X += (this.Width / 2.0f);

            FontManager.DrawString(_result.ToString(), "LargeFont", myPosition,
                                   TextColour, FontAlign.Center);
            myPosition.Y += 40;
            foreach (string line in DescriptionText.Split('\n'))
            {
                FontManager.DrawString(line, "DefaultFont", myPosition,
                                       TextColour, FontAlign.Center);
                myPosition.Y += 25;
            }

            FontManager.DrawString("Press enter when done, or escape to cancel.", "DefaultFont", myPosition,
                                   TextColour, FontAlign.Center);
            myPosition.Y += 25;

            if (Shift)
            {
                _shiftSprite.Y = (int)myPosition.Y;
                _shiftSprite.X = (int)myPosition.X - 50;
                _shiftSprite.Draw();
            }
            if (CapsLock)
            {
                _capsLockSprite.Y = (int)myPosition.Y;
                _capsLockSprite.X = (int)myPosition.X + 50;
                _capsLockSprite.Draw();
            }
        }
Пример #4
0
        public override void Draw()
        {
            if (_baseSprite == null)
            {
                InitSprites();
            }

            Debug.Assert(_baseSprite != null);
            _baseSprite.Draw();

            if (Maximum == 0)
            {
                return;
            }
            Value = Math.Min(Value, Maximum);

            var diff = Value - _displayedValue;

            var changeMx = Math.Min(0.5, TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds * PROGRESS_UPDATE_SPEED);

            _displayedValue += (diff * (changeMx));

            var drawHeight = this.Height * _displayedValue / Maximum;
            var texHeight  = (int)(_frontSprite.Texture.Height * _displayedValue / Maximum);

            _frontSprite.Height = (int)drawHeight;
            _frontSprite.Y      = this.Y + this.Height - (int)drawHeight;
            _frontSprite.DrawTiled(0, _frontSprite.Texture.Height - texHeight, _frontSprite.Texture.Width, texHeight);
            DrawReadyIndicator();
        }
Пример #5
0
        public void Draw(double phraseNumber)
        {
            if (!_spritesInit)
            {
                InitSprites();
            }

            _baseSprite.Size = this.Size;
            _baseSprite.Draw();
            _maxBaseSprite.ColorShading   = Parent.MaxHighlightColors[PlayerID];
            _maxBaseSprite.ColorShading.A = Convert.ToByte(_lastLevelOpacity);

            var maxFrontBeatFraction = (phraseNumber / 4) - Math.Floor(phraseNumber / 4);
            var beatFraction         = (phraseNumber * 4) - Math.Floor(phraseNumber * 4);

            if (LevelBarFull)
            {
                _maxBaseSprite.ColorShading.A = (byte)((1 - beatFraction) * 255);
                _maxFrontOpacity = Math.Min(255, _maxFrontOpacity + (TextureManager.LastDrawnPhraseDiff * MAX_FRONT_SHOW_SPEED));
            }
            else
            {
                _maxFrontOpacity = Math.Max(0, _maxFrontOpacity - (TextureManager.LastDrawnPhraseDiff * MAX_FRONT_HIDE_SPEED));
            }

            _maxFrontSprite.ColorShading.A = (byte)((_maxFrontOpacity));


            _maxBaseSprite.Draw();
            FontManager.DrawString("" + (int)(Parent.Players[PlayerID].Level * Multiplier), "DefaultFont",
                                   _textPosition, Color.Black, FontAlign.Center);

            DrawBars();
            _maxFrontSprite.DrawTiled((int)(maxFrontBeatFraction * _maxFrontSprite.Texture.Width), 0, _maxFrontSprite.Texture.Width, _maxFrontSprite.Texture.Height);
        }
Пример #6
0
        public void Draw(double phraseNumber)
        {
            if (MaxBrightness == 0)
            {
                return;
            }
            if (!_init)
            {
                Initialize();
                _init = true;
            }

            var diff = Opacity - _displayOpacity;

            var changeMx = Math.Min(0.5, TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds * OPACITY_CHANGE_SPEED);

            _displayOpacity += (diff * (changeMx));

            var myOpacity = 255 * Math.Min(MaxBrightness, _displayOpacity) / 255 * (GetBeatFraction(phraseNumber));


            float[] levels     = AudioManager.GetChannelSpectrum(SongChannel, SPECTRUM_POINTS);
            float[] waveLevels = AudioManager.GetChannelWaveform(SongChannel, WAVEFORM_POINTS);

            _mySprite.ColorShading.A = (byte)(myOpacity);
            _mySprite.Draw();

            _spectrumDrawer.ColorShading.A = _spectrumDrawerTop.ColorShading.A = _waveformDrawer.ColorShading.A = (byte)Math.Min(MaxBrightness, _displayOpacity);
            _spectrumDrawerTop.Height      = 50 + (int)(((BAR_HEIGHT)-50) * _displayOpacity / 255);
            _spectrumDrawer.Height         = -_spectrumDrawerTop.Height;
            _waveformDrawer.Height         = 25 + (int)(((BAR_HEIGHT / 2) - 25) * _displayOpacity / 255);
            DrawLevels(levels);

            DrawWaveform(waveLevels);
        }
Пример #7
0
        public override void Draw()
        {
            if (Player.Profile == null)
            {
                return;
            }
            _drawColor.A = Opacity;
            _levelBaseSprite.Position        = new Vector2(this.X, this.Y);
            _levelFrontSprite.Position       = new Vector2(this.X, this.Y + 12);
            _levelBaseSprite.ColorShading.A  = this.Opacity;
            _levelFrontSprite.ColorShading.A = this.Opacity;
            _levelTextPosition = new Vector2(this.X + this.Width - 3, this.Y - 15);

            var progress = Player.GetLevelProgressSafe();

            progress = Math.Min(1, progress);

            _levelFrontSprite.Width = (int)(this.Width * progress);
            _levelFrontSprite.Draw();
            _levelBaseSprite.Width = this.Width;
            _levelBaseSprite.Draw();


            //Draw level text.
            var playerlevel = String.Format("{0:00}", Player.GetLevel());
            var scale       = FontManager.ScaleTextToFit(playerlevel, "TwoTech36", 32, 38);

            FontManager.DrawString(playerlevel, "TwoTech36", _levelTextPosition, scale, _drawColor,
                                   FontAlign.Right);
        }
Пример #8
0
        private void DrawTitleDisplay()
        {
            _songTitleBase.Draw();

            var     textPosition = _songTitleBase.Position.Clone();
            Vector2 scale;

            textPosition.X += 185;
            if (!String.IsNullOrEmpty(DisplayedSong.Title))
            {
                scale = FontManager.ScaleTextToFit(DisplayedSong.Title, "LargeFont", 350, 100);
                FontManager.DrawString(DisplayedSong.Title, "LargeFont",
                                       textPosition, scale, Color.Black, FontAlign.Center);
            }
            textPosition.X += 5;
            textPosition.Y += 25;
            if (!String.IsNullOrEmpty(DisplayedSong.Subtitle))
            {
                scale = FontManager.ScaleTextToFit(DisplayedSong.Subtitle, "DefaultFont", 360, 100);
                FontManager.DrawString(DisplayedSong.Subtitle, "DefaultFont",
                                       textPosition, scale, Color.Black, FontAlign.Center);
            }
            textPosition.Y += 30;
            if (!String.IsNullOrEmpty(DisplayedSong.Artist))
            {
                scale = FontManager.ScaleTextToFit(DisplayedSong.Artist, "DefaultFont", 360, 100);
                FontManager.DrawString(DisplayedSong.Artist, "DefaultFont",
                                       textPosition, scale, Color.Black, FontAlign.Center);
            }
        }
Пример #9
0
        private void DrawSingleBar(Vector2 position, int player, bool allPlayers)
        {
            _rightSprite.ColorShading.A          =
                _leftSpriteMap.ColorShading.A    =
                    _middleSprite.ColorShading.A = (byte)Opacity;
            _rightSprite.Size     = new Vector2(RIGHT_SIDE_WIDTH, this.Height);
            _rightSprite.Position = position.Clone();
            _rightSprite.X       += this.Width - RIGHT_SIDE_WIDTH;
            var barWidth       = this.Width - RIGHT_SIDE_WIDTH - LEFT_SIDE_WIDTH;
            var totalBeatlines = (from e in Players[player].Judgements select e).Take(6).Sum();

            var idx = (Players[player].IsCPUPlayer) ? 4 : player;

            if (allPlayers)
            {
                idx = 5;
            }
            _leftSpriteMap.Draw(idx, LEFT_SIDE_WIDTH, this.Height, position);
            position.X            += LEFT_SIDE_WIDTH;
            _middleSprite.Width    = barWidth;
            _middleSprite.Height   = this.Height;
            _middleSprite.Position = position.Clone();

            var maxWidth       = barWidth;
            var percentageText = " -----";

            if (totalBeatlines >= 5)
            {
                _partsSpriteMap.ColorShading.A = (byte)(_barOpacity * Opacity / 255);
                for (int y = 0; y < (int)BeatlineNoteJudgement.Count; y++)
                {
                    var width = (float)Math.Ceiling((barWidth) * Players[player].Judgements[y] / totalBeatlines);
                    width     = Math.Min(width, maxWidth);
                    maxWidth -= width;
                    _partsSpriteMap.Draw(y, width, this.Height, position);
                    position.X += width;
                }
                _barOpacity    = Math.Min(255, _barOpacity + (TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds * BAR_SHOW_SPEED));
                percentageText = String.Format("{0:F1}%", Players[player].CalculatePercentage());
            }
            else
            {
                _barOpacity = 0;
            }
            _middleSprite.Draw();

            _rightSprite.Draw();
            _rightSprite.X += 35;
            _rightSprite.Y += (this.Height / 2) - 10;
            var textColour = Color.Black;

            textColour.A = (byte)Opacity;
            FontManager.DrawString(percentageText, "DefaultFont", _rightSprite.Position, textColour,
                                   FontAlign.Center);

            position.X = this.Position.X;
        }
Пример #10
0
        private void DrawBase()
        {
            var beatFraction = (SongTime) - Math.Floor(SongTime);

            _baseSprite.Draw();
            _baseBlinkSprite.ColorShading   = GetBlinkColour();
            _baseBlinkSprite.ColorShading.A = (byte)(255 * (1 - beatFraction));
            _baseBlinkSprite.Draw();
        }
Пример #11
0
 private void DrawWarningIcon()
 {
     if (_actualMaxBpm >= 180)
     {
         var beatFraction = (SongTime) - Math.Floor(SongTime);
         _warningSprite.ColorShading.A = (byte)(255 * (1 - beatFraction));
         _warningSprite.Draw();
     }
 }
Пример #12
0
        private void DrawHeader(Vector2 position)
        {
            var headerOffset = (this.Width / 2.0f) - (_headerSprite.Width / 2.0f);

            position.X                  += headerOffset;
            _headerSprite.Position       = position;
            _headerSprite.ColorShading.A = (byte)Opacity;
            _headerSprite.Draw();
            position.X -= headerOffset;
        }
Пример #13
0
 private void DrawEnteredTextBar(Vector2 position)
 {
     position.X += 25;
     _barSideSpriteMap.Draw(0, position);
     position.X               += 35;
     _barMiddleSprite.Width    = this.Width - 120;
     _barMiddleSprite.Position = position;
     _barMiddleSprite.Draw();
     position.X += this.Width - 120;
     _barSideSpriteMap.Draw(1, position);
 }
Пример #14
0
 private void DrawReadyIndicator()
 {
     if (Value == Maximum)
     {
         _opacity = Math.Min(_opacity + (TextureManager.LastDrawnPhraseDiff * READY_FADEIN_SPEED), 255);
         _readySprite.ColorShading.A = (byte)_opacity;
         _readySprite.Draw();
     }
     else
     {
         _opacity = 0;
     }
 }
Пример #15
0
        private void DrawLengthDisplay()
        {
            _songLengthBase.Draw();
            var diff     = (DisplayedSong.Length - DisplayedSong.Offset) - _displayedLength;
            var changeMx = Math.Min(0.5, TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds * BPM_LENGTH_ANIMATION_SPEED);

            _displayedLength += (diff * (changeMx));
            var textPosition = _songLengthBase.Position.Clone();

            textPosition.X += 100;
            textPosition.Y -= 0;
            var ts = TimeSpan.FromSeconds(_displayedLength);

            FontManager.DrawString(String.Format("{0}:{1:00}", ts.Minutes, ts.Seconds), "TwoTech36", textPosition, Color.Black, FontAlign.Right);
        }
Пример #16
0
        private void DrawList()
        {
            _listBackgroundSprite.Height         = 40 + (BOOKMARK_TEXT_SIZE * (Math.Min(VISIBLE_BOOKMARKS, _bookmarkMenu.ItemCount)));
            _listBackgroundSprite.ColorShading.A = (byte)_activeOpacity;

            _listBackgroundSprite.Draw();

            if (!_initiated)
            {
                _initiated = true;
                CreateBookmarkMenu();
                SetBookmark(_selectedSongIndex);
            }
            _bookmarkMenu.Opacity = (byte)_activeOpacity;
            _bookmarkMenu.Draw();
        }
Пример #17
0
        public override void Draw()
        {
            var idx = Player.IsCPUPlayer ? 4 : PlayerIndex;

            _background.Size     = this.Size;
            _background.Position = this.Position;
            _background.Draw();

            _playerIdentifiers.Draw(idx, 45, this.Height - 8, this.X + 3, this.Y + 4);
            _difficultyIcons.Draw((int)Player.PlayerOptions.PlayDifficulty + 1, 30, 30, this.X + 53, this.Y + 3);

            DrawNameBackgrounds();
            DrawText();
            DrawSpeedBlocks();
            DrawLevelBar();
        }
Пример #18
0
        private void DrawCurrentPosition()
        {
            if (CurrentPosition == null || CurrentPosition.Value == 0)
            {
                return;
            }

            var position = this.Position.Clone();

            position.X += 10;
            position.Y += TEXT_HEIGHT;
            var ending = Math.Max(Song.ConvertPhraseToMS(Song.GetEndingTimeInPhrase()) / 1000.0, AudioEnd);

            position.X += (float)(CurrentPosition.Value / ending * _totalBarWidth);
            position.X -= _currentPosition.Width / 2;
            _currentPosition.Position = position;
            _currentPosition.Draw();
        }
Пример #19
0
        private void DrawMenuItems(int startItem, int lastItem)
        {
            int xOptionOffset = CalculateXOptionOffset();
            var position      = new Vector2 {
                X = this.X + 10, Y = this.Y + 30
            };

            for (int i = startItem; i <= lastItem; i++)
            {
                MenuItem menuItem = _menuItems[i];
                Color    drawColor;

                if (IsSelected(menuItem))
                {
                    SelectedItemBackgroundColor.A = Opacity;
                    drawColor = HighlightColor;
                    _selectedItemSprite.ColorShading = SelectedItemBackgroundColor;
                    _selectedItemSprite.Position     = position.Clone();
                    _selectedItemSprite.Y           += 1;
                    _selectedItemSprite.X           -= 5;
                    _selectedItemSprite.Width        = this.Width - 10;
                    _selectedItemSprite.Height       = ItemSpacing + 3;
                    _selectedItemSprite.Draw();
                }
                else
                {
                    drawColor = TextColor;
                }

                drawColor.A = menuItem.Enabled ? Opacity : (byte)(Opacity / 2);
                FontManager.DrawString(menuItem.ItemText, FontName, position, drawColor, FontAlign.Left);
                position.X += xOptionOffset;

                var menuOptionText = menuItem.SelectedText();
                var scale          = FontManager.ScaleTextToFit(menuOptionText, FontName, (int)this.Width - 20 - xOptionOffset,
                                                                1000);

                FontManager.DrawString(menuOptionText, FontName, position, scale, drawColor, FontAlign.Left);


                position.X -= xOptionOffset;
                position.Y += ItemSpacing;
            }
        }
Пример #20
0
        private void DrawSides()
        {
            for (int x = 0; x < 4; x++)
            {
                if (!Parent.Players[x].Playing)
                {
                    continue;
                }

                _sidePart.Position = SidePositions[x];
                _sidePart.Draw();
            }
            _middlePart.Draw();


            FontManager.DrawString(String.Format("{0:D3}", (int)TotalLife()), "LargeFont",
                                   GameCore.Instance.Metrics["CoopLifeBarMiddleText", 0], Color.Black, FontAlign.Center);

            FontManager.DrawString(string.Format("{0:D3}", (int)TrueCapacity), "DefaultFont", GameCore.Instance.Metrics["CoopLifeBarMiddleText", 1], Color.Black, FontAlign.Center);
        }
Пример #21
0
 private void DrawNameBackgrounds()
 {
     if (Player.Team == 1)
     {
         _nameBackground.ColorShading = _blueBackground;
     }
     else if (Player.Team == 2)
     {
         _nameBackground.ColorShading = _redBackground;
     }
     else
     {
         _nameBackground.ColorShading = Color.TransparentWhite;
     }
     _nameBackground.Width  = this.Width - 113;
     _nameBackground.Height = this.Height - 2;
     _nameBackground.X      = this.X + 85;
     _nameBackground.Y      = this.Y + 1;
     _nameBackground.Draw();
 }
Пример #22
0
        public override void Draw()
        {
            var message = "";

            if (!Visible)
            {
                return;
            }

            switch (Status)
            {
            case UpdaterStatus.DISABLED:
                message = "Update checking is disabled. It can be enabled from the Options Menu.";
                break;

            case UpdaterStatus.CHECKING:
                message = "Checking for updates...";
                break;

            case UpdaterStatus.FAILED:
                message = "Update check failed: " + UpdateDetails;
                break;

            case UpdaterStatus.SUCCESSFUL:
                message = DetermineVersionMessage();
                break;
            }

            message = ScrollText(message);

            _updaterFrame.Position = this.Position;
            _updaterFrame.Size     = this.Size;
            _updaterFrame.Draw();
            _textPosition.X = this.X + (int)XOffset + 20;
            _textPosition.Y = this.Y + 25;


            FontManager.DrawString(message, "DefaultFont", _textPosition, Color.White,
                                   FontAlign.Left);
        }
Пример #23
0
        public void Draw(double phraseNumber)
        {
            if (_middleSprite == null)
            {
                InitSprites();
            }
            if (ScoreHistory == null)
            {
                return;
            }

            UpdateDisplayedScores(phraseNumber);
            var position = this.Position.Clone();


            var maxScore = GetCombinedScore();

            if (_displayedRecordScore == 0)
            {
                return;
            }
            var ratio = 1.0 * maxScore / _displayedRecordScore;

            SetOpacity(ratio, phraseNumber);
            var drawColor = Color.Black;

            drawColor.A                  = (byte)Opacity;
            position.X                  += this.Width - _headerSprite.Width;
            _headerSprite.Position       = position.Clone();
            _headerSprite.ColorShading.A = (byte)Opacity;
            _headerSprite.Draw();

            var textPosition = new Vector2(this.X + this.Width - RIGHT_SIDE_WIDTH / 2, this.Y - 13 + (_headerSprite.Height / 2));

            FontManager.DrawString(string.Format("{0:F0}", _displayedRecordScore), "DefaultFont", textPosition, drawColor, FontAlign.Center);
            position.X  = this.X;
            position.Y += 30;
            DrawChallenges((long)_displayedRecordScore, position);
        }
Пример #24
0
        private void DrawSpeedBlocks()
        {
            const int DRAW_HEIGHT = 35;

            _speedBlocks.Y            = this.Y + 1;
            _speedBlocks.X            = this.X + this.Width - _speedBlocks.Width - 2;
            _speedBlocks.ColorShading = _blockColor;
            _speedBlocks.Height       = DRAW_HEIGHT;
            _speedBlocks.Width        = 25;
            _speedBlocks.Draw();

            _speedBlocks.ColorShading = Color.White;
            var numberLit = (from e in _speedOptions where Player.PlayerOptions.BeatlineSpeed >= e select e).Count();
            var litHeight = 1.0 * DRAW_HEIGHT / _speedOptions.Count() * numberLit;

            _speedBlocks.Height = (int)litHeight;
            _speedBlocks.Y      = this.Y + 1 + DRAW_HEIGHT - _speedBlocks.Height;

            var texV2 = _speedBlocks.Texture.Height / _speedOptions.Count() * numberLit;

            _speedBlocks.DrawTiled(0, _speedBlocks.Texture.Height - texV2, _speedBlocks.Texture.Width, texV2);
        }
Пример #25
0
        private void DrawSingleBar(Vector2 position, int player, long challengeScore, long recordScore)
        {
            position = position.Clone();
            _rightSprite.ColorShading.A          =
                _leftSpriteMap.ColorShading.A    =
                    _middleSprite.ColorShading.A = (byte)Opacity;
            _rightSprite.Position = position.Clone();
            _rightSprite.Size     = new Vector2(RIGHT_SIDE_WIDTH, this.Height);
            _rightSprite.X       += this.Width - RIGHT_SIDE_WIDTH;
            var barWidth = this.Width - LEFT_SIDE_WIDTH - RIGHT_SIDE_WIDTH;

            var idx = (player < 5 && GameCore.Instance.Players[player].IsCPUPlayer) ? 4 : player;

            _leftSpriteMap.Draw(idx, LEFT_SIDE_WIDTH, this.Height, position);
            position.X            += LEFT_SIDE_WIDTH;
            _middleSprite.Width    = barWidth;
            _middleSprite.Height   = this.Height;
            _middleSprite.Position = position.Clone();

            _partsSpriteMap.ColorShading.A = (byte)Opacity;

            var ratio = 1.0 * challengeScore / recordScore;

            ratio = Math.Max(Math.Min(1.2, ratio), 0.8);
            var width = barWidth * (ratio - 0.8) / 0.4;

            _partsSpriteMap.Draw(GetBarColour(ratio), (float)width, this.Height, position);

            _middleSprite.Draw();
            _rightSprite.Draw();
            _rightSprite.X += RIGHT_SIDE_WIDTH / 2;
            _rightSprite.Y += (this.Height / 2) - 10;
            var textColour = Color.Black;

            textColour.A = (byte)Opacity;
            FontManager.DrawString("" + challengeScore, "DefaultFont", _rightSprite.Position, textColour,
                                   FontAlign.Center);
        }
Пример #26
0
        public override void Draw()
        {
            CalculatePositions();
            SetOpacity();
            _baseSprite.Draw();
            if (HighScoreEntry == null)
            {
                FontManager.DrawString("No score", "TwoTech24", _namePosition, _textColor,
                                       FontAlign.Center);
                return;
            }

            var displayedName = String.IsNullOrEmpty(HighScoreEntry.Name) ? "GUEST" : HighScoreEntry.Name;

            _gradeSpriteMap.Draw(HighScoreEntry.Grade, 71, 25, _gradePosition);
            _difficultySpriteMap.Draw((int)HighScoreEntry.Difficulty + 1, 25, 25, _difficultyPosition);
            var displayedScore = string.Format("{0:N0}", HighScoreEntry.Score).Replace((char)160, ',');

            FontManager.DrawString(displayedScore, "TwoTech24", _scorePosition, _textColor,
                                   FontAlign.Center);
            FontManager.DrawString("" + displayedName, "TwoTech24", _namePosition, _textColor,
                                   FontAlign.Center);
        }
Пример #27
0
        public override void Draw()
        {
            if (Active)
            {
                _activeOpacity = Math.Min(_activeOpacity + (FADEIN_SPEED * TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds), 255);
            }
            else
            {
                _activeOpacity = Math.Max(_activeOpacity - (FADEOUT_SPEED * TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds), 0);
            }

            SetSpritePositions();
            _backgroundSprite.Draw();
            _textPosition.X = this.X + (this.Width / 2);
            _textPosition.Y = this.Y;
            FontManager.DrawString("" + SongSortMode, "TwoTechLarge", _textPosition, Color.Black, FontAlign.Center);

            _arrowSprites.ColorShading.A = (byte)_activeOpacity;
            _arrowSprites.Draw(1, 35, 35, this.X + 15, this.Y + 8);
            _arrowSprites.Draw(0, 35, 35, this.X + this.Width - 40, this.Y + 8);

            DrawList();
        }
Пример #28
0
        public override void Draw()
        {
            _backgroundSprite.Width    = this.Width;
            _backgroundSprite.Height   = this.Height;
            _backgroundSprite.Position = this.Position;
            _backgroundSprite.Draw();

            //Determine positions.
            _textPosition    = this.Position.Clone();
            _textPosition.X += 60;
            _textPosition.Y += 13;
            _iconPosition    = this.Position.Clone();
            _iconPosition.X += 10;
            _iconPosition.Y += 12;

            //Draw controller Icon
            if (ControllerNumber > 0)
            {
                _controllerNumberSpriteMap.Draw(ControllerNumber - 1, 30, 30, _iconPosition);
                if (_buttonsLookup.Contains(Button))
                {
                    _textPosition.Y -= 3;
                    var btnIndex = _buttonsLookup.IndexOf(Button);
                    _controllerButtonsSpriteMap.Draw(btnIndex, 30, 30, _textPosition);
                }
                else
                {
                    FontManager.DrawString(Button.ToString(), "LargeFont", _textPosition, Color.Black, FontAlign.Left);
                }
            }
            else
            {
                _keyboardIcon.Position = _iconPosition;
                _keyboardIcon.Draw();
                FontManager.DrawString(Key.ToString(), "LargeFont", _textPosition, Color.Black, FontAlign.Left);
            }
        }
Пример #29
0
        public override void Draw()
        {
            if (_barSpriteBack == null)
            {
                InitSprites();
            }
            _barSpriteBack.Draw();

            var          actMx  = _displayedGrooveMomentum - 0.5;
            const double MAX_MX = 6.5;

            if (actMx > 3.5)
            {
                actMx -= (actMx - 3.5) / 2;
            }
            actMx = Math.Min(MAX_MX, actMx);

            var widthRatio = actMx / MAX_MX;

            _barSpriteFront.Width = (this.Size.X - this.BarOffset.X) * (float)widthRatio;
            _barSpriteFront.DrawTiled(0, 0, (float)(_barSpriteFront.Texture.Width * widthRatio), _barSpriteFront.Texture.Height);

            DrawText();
        }
Пример #30
0
 private void DrawGrid()
 {
     _teamGridSprite.Position = this.Position;
     _teamGridSprite.Draw();
 }