示例#1
0
        public void Draw(bool ForceDraw)
        {
            if (!Visible && CSettings.GameState != EGameState.EditTheme && !ForceDraw)
            {
                return;
            }

            STexture texture = new STexture(-1);

            if (!Selected)
            {
                texture = CTheme.GetSkinTexture(_Theme.TextureName);
                CDraw.DrawTexture(texture, Rect, Color);
                if (Reflection)
                {
                    CDraw.DrawTextureReflection(texture, Rect, Color, Rect, ReflectionSpace, ReflectionHeight);
                }
            }
            else
            {
                texture = CTheme.GetSkinTexture(_Theme.STextureName);
                CDraw.DrawTexture(texture, Rect, SColor);
                if (Reflection)
                {
                    CDraw.DrawTextureReflection(texture, Rect, SColor, Rect, ReflectionSpace, ReflectionHeight);
                }
            }

            Text.DrawRelative(Rect.X, Rect.Y);
            if (Reflection)
            {
                Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H);
            }
        }
示例#2
0
        public void Draw()
        {
            if (_Movetimer.IsRunning && _Movetimer.ElapsedMilliseconds / 1000f > CSettings.MouseMoveOffTime)
            {
                _Movetimer.Stop();
                Fade(0f, 0.5f);
            }


            if (_CursorFadingTimer.IsRunning)
            {
                float t = _CursorFadingTimer.ElapsedMilliseconds / 1000f;
                if (t < _CursorFadingTime)
                {
                    if (_CursorTargetAlpha >= _CursorStartAlpha)
                    {
                        _Cursor.color.A = _CursorStartAlpha + (_CursorTargetAlpha - _CursorStartAlpha) * t / _CursorFadingTime;
                    }
                    else
                    {
                        _Cursor.color.A = (_CursorStartAlpha - _CursorTargetAlpha) * (1f - t / _CursorFadingTime);
                    }
                }
                else
                {
                    _CursorFadingTimer.Stop();
                    _Cursor.color.A = _CursorTargetAlpha;
                }
            }

            if (CursorVisible && (CSettings.GameState == EGameState.EditTheme || ShowCursor))
            {
                CDraw.DrawTexture(_Cursor);
            }
        }
示例#3
0
        public override bool Draw()
        {
            DrawBG();

            if (!CheckMicConfig())
            {
                Statics[htStatics(StaticWarning)].Visible = true;
                Texts[htTexts(TextWarning)].Visible       = true;
            }
            else
            {
                Statics[htStatics(StaticWarning)].Visible = false;
                Texts[htTexts(TextWarning)].Visible       = false;
            }

            for (int i = 0; i < StaticEnergyChannel.Length; i++)
            {
                if (ChannelEnergy[i] > 0f)
                {
                    SRectF rect = new SRectF(Statics[htStatics(StaticEnergyChannel[i])].Rect.X,
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.Y,
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.W * ChannelEnergy[i],
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.H,
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.Z);

                    CDraw.DrawTexture(Statics[htStatics(StaticEnergyChannel[i])].Texture, Statics[htStatics(StaticEnergyChannel[i])].Rect,
                                      new SColorF(1f, 1f, 1f, 1f), rect);
                }
            }

            DrawFG();

            return(true);
        }
示例#4
0
        public void DrawGlyph(char chr, float fontHeight, float x, float y, float z, SColorF color, float begin, float end)
        {
            CTextureRef texture;
            SRectF      rect;

            GetOrAddGlyph(chr, fontHeight).GetTextureAndRect(fontHeight, x, y, z, out texture, out rect);
            CDraw.DrawTexture(texture, rect, color, begin, end);
        }
示例#5
0
        public void DrawGlyph(char chr, float fontHeight, float x, float y, float z, SColorF color, bool allMonitors = true)
        {
            CTextureRef texture;
            SRectF      rect;

            GetOrAddGlyph(chr, fontHeight).GetTextureAndRect(fontHeight, x, y, z, out texture, out rect);
            CDraw.DrawTexture(texture, rect, color, false, allMonitors);
        }
示例#6
0
        public virtual void Draw()
        {
            if (!_Initialized || !_Visible)
            {
                return;
            }

            if (_video != -1)
            {
                CDraw.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0));
            }
        }
示例#7
0
        public void Draw(float scale, float z, bool aspect, bool ForceDraw)
        {
            STexture texture;

            if (_Texture.index != -1)
            {
                texture = _Texture;
            }
            else
            {
                texture = CTheme.GetSkinTexture(_Theme.TextureName);
            }

            SRectF bounds = new SRectF(
                Rect.X - Rect.W * (scale - 1f),
                Rect.Y - Rect.H * (scale - 1f),
                Rect.W + 2 * Rect.W * (scale - 1f),
                Rect.H + 2 * Rect.H * (scale - 1f),
                z);

            SRectF rect = bounds;

            if (aspect)
            {
                RectangleF bounds2 = new RectangleF(bounds.X, bounds.Y, bounds.W, bounds.H);
                RectangleF rect2   = new RectangleF(0f, 0f, texture.width, texture.height);
                CHelper.SetRect(bounds2, ref rect2, texture.width / texture.height, EAspect.Crop);

                rect.X = rect2.X;
                rect.Y = rect2.Y;
                rect.W = rect2.Width;
                rect.H = rect2.Height;
            }

            SColorF color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha);

            if (Visible || ForceDraw || (CSettings.GameState == EGameState.EditTheme))
            {
                CDraw.DrawTexture(texture, rect, color, bounds);
                if (Reflection)
                {
                    CDraw.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight);
                }
            }

            if (Selected && (CSettings.GameState == EGameState.EditTheme))
            {
                CDraw.DrawColor(new SColorF(1f, 1f, 1f, 0.5f), rect);
            }
        }
示例#8
0
        private void DrawNoteBG(SRectF Rect, SColorF Color, float factor, Stopwatch Timer)
        {
            const int   spacing = 0;
            const float period  = 1.5f; //[s]

            if (!Timer.IsRunning)
            {
                Timer.Start();
            }

            if (Timer.ElapsedMilliseconds / 1000f > period)
            {
                Timer.Reset();
                Timer.Start();
            }

            float alpha = (float)((Math.Cos((Timer.ElapsedMilliseconds / 1000f) / period * Math.PI * 2) + 1) / 2.0) / 2f + 0.5f;
            float d     = (1f - factor) / 2 * Rect.H;
            float dw    = d;

            if (2 * dw > Rect.W)
            {
                dw = Rect.W / 2;
            }

            SRectF r = new SRectF(
                Rect.X + dw + spacing,
                Rect.Y + d + spacing,
                Rect.W - 2 * dw - 2 * spacing,
                Rect.H - 2 * d - 2 * spacing,
                Rect.Z
                );

            STexture NoteBackgroundBegin  = CTheme.GetSkinTexture(_Theme.SkinBackgroundLeftName);
            STexture NoteBackgroundMiddle = CTheme.GetSkinTexture(_Theme.SkinBackgroundMiddleName);
            STexture NoteBackgroundEnd    = CTheme.GetSkinTexture(_Theme.SkinBackgroundRightName);

            float dx = NoteBackgroundBegin.width * r.H / NoteBackgroundBegin.height;

            if (2 * dx > r.W)
            {
                dx = r.W / 2;
            }

            SColorF col = new SColorF(Color.R, Color.G, Color.B, Color.A * alpha);

            CDraw.DrawTexture(NoteBackgroundBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), col);
            CDraw.DrawTexture(NoteBackgroundMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), col);
            CDraw.DrawTexture(NoteBackgroundEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), col);
        }
示例#9
0
        private bool DrawVideo()
        {
            STexture VideoTexture = CTheme.GetSkinVideoTexture(_Theme.VideoName);

            if (VideoTexture.height > 0)
            {
                RectangleF bounds = new RectangleF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH);
                RectangleF rect   = new RectangleF(0f, 0f, VideoTexture.width, VideoTexture.height);
                CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);

                CDraw.DrawTexture(VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CSettings.zFar / 4));
                return(true);
            }
            return(false);
        }
        public override bool Draw()
        {
            if (!_Active)
            {
                return(false);
            }
            Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.Cover;
            if (CBackgroundMusic.VideoEnabled && VideoPreview && CBackgroundMusic.SongHasVideo)
            {
                CDraw.DrawTexture(Statics[htStatics(StaticCover)], CBackgroundMusic.GetVideoTexture(), EAspect.Crop);
            }
            Buttons[htButtons(ButtonPause)].Visible = CBackgroundMusic.Playing;
            Buttons[htButtons(ButtonPlay)].Visible  = !CBackgroundMusic.Playing;
            Texts[htTexts(TextCurrentSong)].Text    = CBackgroundMusic.ArtistAndTitle;

            return(base.Draw());
        }
示例#11
0
        public override void Draw()
        {
            base.Draw();

            for (int i = 0; i < _StaticEnergyPlayer.Length; i++)
            {
                if (_ChannelEnergy[i] > 0f)
                {
                    var rect = new SRectF(_Statics[_StaticEnergyPlayer[i]].Rect.X,
                                          _Statics[_StaticEnergyPlayer[i]].Rect.Y + (_Statics[_StaticEnergyPlayer[i]].Rect.H - (_Statics[_StaticEnergyPlayer[i]].Rect.H * _ChannelEnergy[i])),
                                          _Statics[_StaticEnergyPlayer[i]].Rect.W,
                                          _Statics[_StaticEnergyPlayer[i]].Rect.H * _ChannelEnergy[i],
                                          _Statics[_StaticEnergyPlayer[i]].Rect.Z);

                    CDraw.DrawTexture(_Statics[_StaticEnergyPlayer[i]].Texture, _Statics[_StaticEnergyPlayer[i]].Rect,
                                      new SColorF(1f, 1f, 1f, 1f), rect);
                }
            }
        }
示例#12
0
        private void DrawNote(SRectF Rect, SColorF Color, float factor)
        {
            const int spacing = 0;

            float d  = (1f - factor) / 2 * Rect.H;
            float dw = d;

            if (2 * dw > Rect.W)
            {
                dw = Rect.W / 2;
            }

            SRectF r = new SRectF(
                Rect.X + dw + spacing,
                Rect.Y + d + spacing,
                Rect.W - 2 * dw - 2 * spacing,
                Rect.H - 2 * d - 2 * spacing,
                Rect.Z
                );

            STexture NoteBegin  = CTheme.GetSkinTexture(_Theme.SkinLeftName);
            STexture NoteMiddle = CTheme.GetSkinTexture(_Theme.SkinMiddleName);
            STexture NoteEnd    = CTheme.GetSkinTexture(_Theme.SkinRightName);

            float dx = NoteBegin.width * r.H / NoteBegin.height;

            if (2 * dx > r.W)
            {
                dx = r.W / 2;
            }


            CDraw.DrawTexture(NoteBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), Color);
            CDraw.DrawTexture(NoteMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), Color);
            CDraw.DrawTexture(NoteEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), Color);
        }
示例#13
0
        public void Draw()
        {
            if (!_Finished)
            {
                float VideoTime = _VideoTimer.ElapsedMilliseconds / 1000f;
                _Finished = CVideo.VdFinished(_VideoStream);

                STexture tex = new STexture(-1);
                tex.height = 0f;
                CVideo.VdGetFrame(_VideoStream, ref tex, VideoTime, ref VideoTime);

                if (tex.height > 0)
                {
                    CDraw.RemoveTexture(ref _VideoTexture);
                    _VideoTexture = tex;
                }
            }
            RectangleF bounds = new RectangleF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH);
            RectangleF rect   = new RectangleF(0f, 0f, _VideoTexture.width, _VideoTexture.height);

            CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);

            CDraw.DrawTexture(_VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CSettings.zFar / 4));
        }
示例#14
0
        private void DrawToneHelper(int n, int BaseLine, float XOffset)
        {
            int TonePlayer = CSound.RecordGetToneAbs(_PlayerNotes[n].PlayerNr);

            SRectF Rect = _PlayerNotes[n].Rect;

            while (TonePlayer - BaseLine < 0)
            {
                TonePlayer += 12;
            }

            while (TonePlayer - BaseLine > 12)
            {
                TonePlayer -= 12;
            }

            if (XOffset < 0f)
            {
                XOffset = 0f;
            }

            if (XOffset > Rect.W)
            {
                XOffset = Rect.W;
            }

            float  dy   = Rect.H / (CSettings.NumNoteLines);
            SRectF rect = new SRectF(
                Rect.X - dy + XOffset,
                Rect.Y + dy * (CSettings.NumNoteLines - 1 - (TonePlayer - BaseLine) / 2f),
                dy,
                dy,
                Rect.Z
                );

            SColorF color = new SColorF(
                _PlayerNotes[n].Color.R,
                _PlayerNotes[n].Color.G,
                _PlayerNotes[n].Color.B,
                _PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha);

            STexture ToneHelper = CTheme.GetSkinTexture(_Theme.SkinToneHelperName);

            CDraw.DrawTexture(ToneHelper, rect, color);


            while (TonePlayer - BaseLine < 12)
            {
                TonePlayer += 12;
            }

            while (TonePlayer - BaseLine > 24)
            {
                TonePlayer -= 12;
            }

            rect = new SRectF(
                Rect.X - dy + XOffset,
                Rect.Y + dy * (CSettings.NumNoteLines - 1 - (TonePlayer - BaseLine) / 2f),
                dy,
                dy,
                Rect.Z
                );

            CDraw.DrawTexture(ToneHelper, rect, color);
        }
示例#15
0
        private void DrawLyricHelper()
        {
            if (_FadeOut)
            {
                return;
            }

            if (!CSound.IsPlaying(_CurrentStream) && !CSound.IsPaused(_CurrentStream))
            {
                return;
            }

            CSong song = CGame.GetSong();

            if (song == null)
            {
                return;
            }

            float alpha = (float)((Math.Cos(_CurrentTime * Math.PI * 2) + 1) / 2.0) / 2f + 0.5f;

            if (_TimeToFirstNote > CSettings.LyricHelperMinTime && _RemainingTimeToFirstNote > 0f && _RemainingTimeToFirstNote < CSettings.LyricHelperEnableTime)
            {
                float time      = _RemainingTimeToFirstNote;
                float totaltime = CSettings.LyricHelperMoveTime;

                if (totaltime > _TimeToFirstNote)
                {
                    totaltime = _TimeToFirstNote;
                }

                if (time > totaltime)
                {
                    time = totaltime;
                }

                SRectF  Rect  = Statics[htStatics(StaticLyricHelper)].Rect;
                SColorF Color = new SColorF(
                    Statics[htStatics(StaticLyricHelper)].Color.R,
                    Statics[htStatics(StaticLyricHelper)].Color.G,
                    Statics[htStatics(StaticLyricHelper)].Color.B,
                    Statics[htStatics(StaticLyricHelper)].Color.A * Statics[htStatics(StaticLyricHelper)].Alpha * alpha);

                float distance = Lyrics[htLyrics(LyricMain)].GetCurrentLyricPosX() - Rect.X - Rect.W;
                CDraw.DrawTexture(Statics[htStatics(StaticLyricHelper)].Texture,
                                  new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), Color);

                if (Statics[htStatics(StaticLyricsTop)].Visible)
                {
                    Rect  = Statics[htStatics(StaticLyricHelperTop)].Rect;
                    Color = new SColorF(
                        Statics[htStatics(StaticLyricHelperTop)].Color.R,
                        Statics[htStatics(StaticLyricHelperTop)].Color.G,
                        Statics[htStatics(StaticLyricHelperTop)].Color.B,
                        Statics[htStatics(StaticLyricHelperTop)].Color.A * Statics[htStatics(StaticLyricHelper)].Alpha * alpha);

                    distance = Lyrics[htLyrics(LyricMainTop)].GetCurrentLyricPosX() - Rect.X - Rect.W;
                    CDraw.DrawTexture(Statics[htStatics(StaticLyricHelperTop)].Texture,
                                      new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), Color);
                }
            }

            if (song.IsDuet)
            {
                if (_TimeToFirstNoteDuet > CSettings.LyricHelperMinTime && _RemainingTimeToFirstNoteDuet > 0f && _RemainingTimeToFirstNoteDuet < CSettings.LyricHelperEnableTime)
                {
                    float time      = _RemainingTimeToFirstNoteDuet;
                    float totaltime = CSettings.LyricHelperMoveTime;

                    if (totaltime > _TimeToFirstNoteDuet)
                    {
                        totaltime = _TimeToFirstNoteDuet;
                    }

                    if (time > totaltime)
                    {
                        time = totaltime;
                    }

                    SRectF Rect = Statics[htStatics(StaticLyricHelperDuet)].Rect;

                    SColorF Color = new SColorF(
                        Statics[htStatics(StaticLyricHelperDuet)].Color.R,
                        Statics[htStatics(StaticLyricHelperDuet)].Color.G,
                        Statics[htStatics(StaticLyricHelperDuet)].Color.B,
                        Statics[htStatics(StaticLyricHelperDuet)].Color.A * Statics[htStatics(StaticLyricHelperDuet)].Alpha * alpha);

                    float distance = Lyrics[htLyrics(LyricMainDuet)].GetCurrentLyricPosX() - Rect.X - Rect.W;
                    CDraw.DrawTexture(Statics[htStatics(StaticLyricHelperDuet)].Texture,
                                      new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z),
                                      Color);
                }
            }
        }
示例#16
0
        public void Draw()
        {
            if (!Visible && CSettings.GameState != EGameState.EditTheme)
            {
                return;
            }

            STexture Texture           = CTheme.GetSkinTexture(_Theme.TextureName);
            STexture TextureArrowLeft  = CTheme.GetSkinTexture(_Theme.TextureArrowLeftName);
            STexture TextureArrowRight = CTheme.GetSkinTexture(_Theme.TextureArrowRightName);

            STexture STexture           = CTheme.GetSkinTexture(_Theme.STextureName);
            STexture STextureArrowLeft  = CTheme.GetSkinTexture(_Theme.STextureArrowLeftName);
            STexture STextureArrowRight = CTheme.GetSkinTexture(_Theme.STextureArrowRightName);

            STexture HTexture = CTheme.GetSkinTexture(_Theme.HTextureName);

            if (Selected)
            {
                if (Highlighted)
                {
                    CDraw.DrawTexture(HTexture, Rect, HColor);
                }
                else
                {
                    CDraw.DrawTexture(STexture, Rect, SColor);
                }
            }
            else
            {
                CDraw.DrawTexture(Texture, Rect, Color);
            }

            if (_Selection > 0 || CSettings.GameState == EGameState.EditTheme)
            {
                if (_ArrowLeftSelected)
                {
                    CDraw.DrawTexture(STextureArrowLeft, RectArrowLeft, SColorArrow);
                }
                else
                {
                    CDraw.DrawTexture(TextureArrowLeft, RectArrowLeft, ColorArrow);
                }
            }

            if (_Selection < _ValueNames.Count - 1 || CSettings.GameState == EGameState.EditTheme)
            {
                if (_ArrowRightSelected)
                {
                    CDraw.DrawTexture(STextureArrowRight, RectArrowRight, SColorArrow);
                }
                else
                {
                    CDraw.DrawTexture(TextureArrowRight, RectArrowRight, ColorArrow);
                }
            }

            if (_NumVisible < 1 || _ValueNames.Count == 0)
            {
                return;
            }

            float x  = Rect.X + Rect.W * 0.1f;
            float dx = Rect.W * 0.8f / _NumVisible;
            //float y = Rect.Y + (Rect.H - TextH);

            int offset = _Selection - (int)_NumVisible / 2;

            if (_ValueNames.Count - _NumVisible - offset < 0)
            {
                offset = _ValueNames.Count - _NumVisible;
            }

            if (offset < 0)
            {
                offset = 0;
            }


            int numvis = _NumVisible;

            if (_ValueNames.Count < numvis)
            {
                numvis = _ValueNames.Count;
            }

            _ValueBounds.Clear();
            for (int i = 0; i < numvis; i++)
            {
                CText   Text  = new CText(0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, _ValueNames[i + offset]);
                SColorF Alpha = new SColorF(1f, 1f, 1f, 0.35f);
                if (i + offset == _Selection)
                {
                    Text.Color = STextColor;
                    Alpha      = new SColorF(1f, 1f, 1f, 1f);
                }

                RectangleF bounds = CDraw.GetTextBounds(Text);
                Text.X = x + dx / 2f + dx * i;

                if (!WithTextures)
                {
                    Text.Y = (int)(Rect.Y + (Rect.H - bounds.Height) / 2);
                }
                else
                {
                    Text.Y = (int)(Rect.Y + (Rect.H - bounds.Height));
                }

                Text.Z = Rect.Z;
                Text.Draw();

                if (WithTextures)
                {
                    float  dh   = Text.Y - Rect.Y - Rect.H * 0.1f;
                    SRectF rect = new SRectF(Text.X - dh / 2, Rect.Y + Rect.H * 0.05f, dh, dh, Rect.Z);
                    CDraw.DrawTexture(_Textures[i + offset], rect, Alpha);
                    _ValueBounds.Add(rect);
                }
                else
                {
                    _ValueBounds.Add(new SRectF(Text.X - bounds.Width / 2f, Text.Y, bounds.Width, bounds.Height, Rect.Z));
                }
            }
        }
示例#17
0
        public override void Draw()
        {
            foreach (CStatic tile in _Tiles)
            {
                if (tile.Selected && _Active)
                {
                    tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false);
                }
                else
                {
                    if (tile.Texture.index != _CoverTexture.index)
                    {
                        tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false);
                    }
                    else
                    {
                        tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false);
                    }
                }
            }

            if (CSongs.Category >= 0)
            {
                int actsong = _PreviewSelected;
                if ((CSongs.NumVisibleSongs > actsong) && (actsong >= 0))
                {
                    CSong song = CSongs.VisibleSongs[actsong];

                    _CoverBig.Texture       = song.CoverTextureSmall;
                    _Artist.Text            = song.Artist;
                    _Title.Text             = song.Title;
                    _DuetIcon.Visible       = song.IsDuet;
                    _VideoIcon.Visible      = song.VideoFileName.Length > 0;
                    _MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated;
                    _MedleyTagIcon.Visible  = song.Medley.Source == EMedleySource.Tag;

                    float Time = CSound.GetLength(_SongStream);
                    if (song.Finish != 0)
                    {
                        Time = song.Finish;
                    }

                    Time -= song.Start;
                    int min = (int)Math.Floor(Time / 60f);
                    int sec = (int)(Time - min * 60f);
                    _SongLength.Text = min.ToString("00") + ":" + sec.ToString("00");
                }
            }
            else
            {
                int actcat = _PreviewSelected;
                if ((CSongs.NumCategories > actcat) && (actcat >= 0))
                {
                    _CoverBig.Texture = CSongs.Categories[actcat].CoverTextureSmall;
                    _Artist.Text      = CSongs.Categories[actcat].Name;

                    int num = CSongs.NumSongsInCategory(actcat);
                    if (num != 1)
                    {
                        _Title.Text = CLanguage.Translate("TR_SCREENSONG_NUMSONGS").Replace("%v", num.ToString());
                    }
                    else
                    {
                        _Title.Text = CLanguage.Translate("TR_SCREENSONG_NUMSONG").Replace("%v", num.ToString());
                    }

                    _SongLength.Text        = String.Empty;
                    _DuetIcon.Visible       = false;
                    _VideoIcon.Visible      = false;
                    _MedleyCalcIcon.Visible = false;
                    _MedleyTagIcon.Visible  = false;
                }
            }

            _TextBG.Draw();

            _CoverBig.Draw(1f, EAspect.Crop);
            if (_vidtex.color.A < 1)
            {
                _CoverBig.Draw(1f, EAspect.Crop);
            }

            if (_vidtex.index != -1 && _Video != -1)
            {
                RectangleF bounds = new RectangleF(_CoverBig.Rect.X, _CoverBig.Rect.Y, _CoverBig.Rect.W, _CoverBig.Rect.H);
                RectangleF rect   = new RectangleF(0f, 0f, _vidtex.width, _vidtex.height);
                CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);

                CDraw.DrawTexture(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z),
                                  _vidtex.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false);
                CDraw.DrawTextureReflection(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z),
                                            _vidtex.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
            }



            _Artist.Draw();
            _Title.Draw();
            _SongLength.Draw();
            _DuetIcon.Draw();
            _VideoIcon.Draw();
            _MedleyCalcIcon.Draw();
            _MedleyTagIcon.Draw();
        }
示例#18
0
        public override bool Draw()
        {
            if (_Active)
            {
                if (_CurrentVideo != -1 && CConfig.VideosInSongs == EOffOn.TR_CONFIG_ON)
                {
                    RectangleF bounds = new RectangleF(0, 0, CSettings.iRenderW, CSettings.iRenderH);
                    RectangleF rect   = new RectangleF(0f, 0f, _CurrentVideoTexture.width, _CurrentVideoTexture.height);
                    CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, _VideoAspect);

                    CDraw.DrawTexture(_CurrentVideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, 0f),
                                      _CurrentVideoTexture.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false);
                }
                else
                {   // Draw Background
                    RectangleF bounds = new RectangleF(0, 0, CSettings.iRenderW, CSettings.iRenderH);
                    RectangleF rect   = new RectangleF(0f, 0f, _Background.width, _Background.height);
                    CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);

                    CDraw.DrawTexture(_Background, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, 0f),
                                      _Background.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false);
                }
            }

            base.DrawBG();

            foreach (CStatic stat in Statics)
            {
                stat.Draw();
            }

            foreach (CText text in Texts)
            {
                text.Draw();
            }

            switch (CConfig.TimerLook)
            {
            case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
                CDraw.DrawTexture(Statics[htStatics(StaticTimeLine)].Texture, Statics[htStatics(StaticTimeLine)].Rect, new SColorF(1, 1, 1, 1), _TimeLineRect);
                break;

            case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
                for (int i = 0; i < _TimeRects.Count; i++)
                {
                    CDraw.DrawTexture(_TimeRects[i].rect.Texture, Statics[htStatics(StaticTimeLine)].Rect, _TimeRects[i].rect.Color, _TimeRects[i].rect.Rect);
                }
                break;
            }

            Lyrics[htLyrics(LyricSub)].Draw(-100);
            Lyrics[htLyrics(LyricMain)].Draw(CGame.Beat);

            Lyrics[htLyrics(LyricSubDuet)].Draw(-100);
            Lyrics[htLyrics(LyricMainDuet)].Draw(CGame.Beat);

            Lyrics[htLyrics(LyricSubTop)].Draw(-100);
            Lyrics[htLyrics(LyricMainTop)].Draw(CGame.Beat);


            for (int i = 0; i < CGame.NumPlayer; i++)
            {
                SingNotes[htSingNotes(SingBars)].Draw(NoteLines[i], CGame.Player[i].SingLine, i);
            }

            DrawLyricHelper();

            if (_Pause)
            {
                Statics[htStatics(StaticPauseBG)].ForceDraw();
                Texts[htTexts(TextPause)].ForceDraw();

                foreach (CButton button in Buttons)
                {
                    button.Draw();
                }

                foreach (CSelectSlide slide in SelectSlides)
                {
                    slide.Draw();
                }
            }

            return(true);
        }