コード例 #1
0
        /*
         * protected override void LoadComplete()
         * {
         *  base.LoadComplete();
         * }
         */

        /// <summary>
        ///     Add HitObject
        /// </summary>
        /// <param name="h"></param>
        public override void Add(DrawableHitObject h)
        {
            //Add MainLyric
            KaraokeLyricPlayField.Add(h as DrawableLyric);

            //Add note
            if (KaraokeTonePlayfield != null)
            {
                var drawableNote = new DrawableNotes(h.HitObject as Lyric)
                {
                    AccentColour = Color4.BlueViolet
                };
                KaraokeTonePlayfield.Add(drawableNote);
            }
        }
コード例 #2
0
        protected DrawableNotes CreateDrawableHitObject(int column = -1)
        {
            if (column == -1)
            {
                var rng = new Random(1337);
                column = rng.Next(0, 4);
            }

            var note = DemoKaraokeObject.GenerateWithStartAndDuration(0, 10000);

            note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
            var drawableNote = new DrawableNotes(note)
            {
                X             = 100,
                Width         = 100,
                LifetimeStart = double.MinValue,
                LifetimeEnd   = double.MaxValue,
                AccentColour  = Color4.Red,
            };

            return(drawableNote);
        }
コード例 #3
0
        public DevelopNoteUi()
        {
            var rng = new Random(1337);

            /*
             * AddStep("test columns", () =>
             * {
             *  Clear();
             *
             *  var drawableNote = CreateDrawableHitObject();
             *
             *  var column = new Column();
             *  column.VisibleTimeRange.Value = 1000;
             *  column.VisibleTimeRange.TriggerChange();
             *  column.AccentColour = Color4.Blue;
             *  Add(column);
             *
             *  column.Add(drawableNote);
             * });
             */

            /*
             * AddStep("test stage", () =>
             * {
             *  Clear();
             *
             *  var drawableNote = CreateDrawableHitObject();
             *
             *  //add stage
             *  var stage = new KaraokeStage(0,new StageDefinition(){Columns = 10});
             *  Add(stage);
             *
             *  //add hit object
             *  stage.Add(drawableNote);
             * });
             */

            AddStep("test playField", () =>
            {
                var drawableNote = CreateDrawableHitObject();

                //add playfield
                var stages = new List <KaraokeStageDefinition>
                {
                    new KaraokeStageDefinition
                    {
                        Columns     = 11,
                        DefaultTone = new Tone(),
                    },
                    new KaraokeStageDefinition
                    {
                        Columns     = 11,
                        DefaultTone = new Tone(),
                    },
                };
                playfield = createPlayfield(stages);

                playfield.Add(drawableNote);
            });


            //add hitExplosion
            AddStep("Hit explosion", () =>
            {
                int col = rng.Next(0, 4);

                var note = DemoKaraokeObject.GenerateWithStartAndDuration(0, 10000);
                note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                var drawableNote = new DrawableNotes(note)
                {
                    //AccentColour = playfield.Columns.ElementAt(col).AccentColour
                };

                //playfield.OnJudgement(drawableNote, new KaraokeJudgement { Result = HitResult.Perfect });
                //playfield.Columns[col].OnJudgement(drawableNote, new ManiaJudgement { Result = HitResult.Perfect });
            });

            //add note
            AddStep("Add Note", () =>
            {
                int col  = rng.Next(0, 4);
                var note = DemoKaraokeObject.GenerateWithStartAndDuration(0, 10000);

                note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                var drawableNote = new DrawableNotes(note)
                {
                    //AccentColour = playfield.Columns.ElementAt(col).AccentColour
                };

                playfield.Add(drawableNote);
            });
        }