示例#1
0
        public void Draw(Matrix view, Matrix projection)
        {
            if (laneTexture == null)
            {
                laneTexture = new QuadTexture(Globals.Textures["FootHold"]);
            }
            laneTexture.SetVerts(MaxX, MinX, -(float)Globals.StepNoteHeightOffset, 300);
            laneTexture.Draw(view, projection);

            if (footTexture == null)
            {
                footTexture = new QuadTexture(RawX <= TouchSettings.AbsX / 2 ? Globals.Textures["FootLeft"] : Globals.Textures["FootRight"]);
            }
            footTexture.SetVerts(X + Globals.FootWidth / 2, X - Globals.FootWidth / 2, -(float)Globals.StepNoteHeightOffset, (float)Globals.StepNoteHeightOffset, -0.05f);

            footTexture.Draw(view, projection);
        }
示例#2
0
        //public void Draw(double currentBeat, Matrix view, Matrix projection)
        //{
        //    // Draw everything but the start note
        //    for (int i = 0; i < Notes.Count; i++)
        //    {
        //        var prevNote = i == 0 ? StartNote : Notes[i - 1];
        //        Notes[i].Draw(currentBeat, view, projection, prevNote);
        //    }

        //    // Draw start note
        //    StartNote.Draw(currentBeat, view, projection);

        //    // Draw hit texture if necessary
        //    if (IsPlayerHolding)
        //        HitTexture.Draw(view, projection);
        //}

        public void Draw(double currentBeat, Matrix view, Matrix projection, int overlapIndex = 0)
        {
            // Draw order
            // Hold bodies
            // Slides
            // Then shuffles
            // The Notes

            // Draw hold bodies first
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Hold || Notes[i].Type == NoteType.Shuffle)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex, NoteType.Hold);
                }
            }
            // Then draw slides
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Slide)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex);
                }
                ;
            }
            // Then draw shuffles
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Shuffle)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex, NoteType.Shuffle);
                }
                ;
            }
            // Then draw notes
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Step)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex);
                }
                ;
            }

            // Draw start note
            StartNote.Draw(currentBeat, view, projection);

            // Draw hit texture if necessary
            if (Notes.Last().BeatLocation < currentBeat)    // Sanity check first
            {
                IsPlayerHolding = false;
            }
            if (IsPlayerHolding)
            {
                HitTexture.Draw(view, projection);
            }
        }