Example #1
0
 private void load(RulesetStore rulesets)
 {
     Add(new DrawableEditableKaraokeObject(DemoKaraokeObject.GenerateWithStartAndDuration(0, 100000))
     {
         Position = new Vector2(100, 100),
         //ProgressUpdateByTime = false,
     });
 }
        protected List <Lyric> Convert(List <HitObject> originalHitOjects)
        {
            var listRerturn = new List <Lyric>();

            for (var i = 0; i < originalHitOjects.Count; i++)
            {
                if (i % 5 == 4)
                {
                    var duration      = originalHitOjects[i].StartTime - originalHitOjects[i - 4].StartTime;
                    var karaokeObject = DemoKaraokeObject.GenerateWithStartAndDuration(originalHitOjects[i].StartTime, duration);
                    listRerturn.Add(karaokeObject);
                }
            }

            return(listRerturn);
        }
Example #3
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);
        }
Example #4
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);
            });
        }
        public DevelopLyric()
        {
            LyricContainer drawableLyric = null;

            Add(new Container
            {
                Padding          = new MarginPadding(25f),
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    drawableLyric = new LyricContainer
                    {
                        Lyric            = DemoKaraokeObject.GenerateWithStartAndDuration(1000, 3000),
                        RelativeSizeAxes = Axes.Both,
                        AutoSizeAxes     = Axes.None,
                    },
                    new Box
                    {
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Y,
                        Size             = new Vector2(3, 1),
                        Colour           = Color4.HotPink,
                    },
                    new Box
                    {
                        Anchor           = Anchor.CentreRight,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Y,
                        Size             = new Vector2(3, 1),
                        Colour           = Color4.HotPink,
                    },
                    new Box
                    {
                        Anchor           = Anchor.TopCentre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.X,
                        Size             = new Vector2(1, 3),
                        Colour           = Color4.HotPink,
                    },
                    new Box
                    {
                        Anchor           = Anchor.BottomCentre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.X,
                        Size             = new Vector2(1, 3),
                        Colour           = Color4.HotPink,
                    }
                }
            });


            /*
             * var drawableMasktext = new PartialLyric
             * {
             *  TopText = "Hello",
             *  MainText = "Hello",
             *  BottomText = "Hello",
             *  Progress = 0.6f,
             *  Origin = Anchor.Centre,
             *  Anchor = Anchor.Centre,
             *  FrontTextColor = Color4.Blue
             * };
             *
             * Add(drawableMasktext);
             */


            /*
             * var drawableMasktext = new MaskText
             * {
             *  Text = "Hello",
             *  Progress = 0.6f,
             *  TextSize = 50,
             *  Origin = Anchor.Centre,
             *  Anchor = Anchor.Centre,
             *  FrontTextColor = Color4.Blue
             * };
             *
             * Add(drawableMasktext);
             */
        }