private void createSliderBar(bool hasDescription = false) { AddStep("create component", () => { LabelledSliderBar <double> component; Child = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, Width = 500, AutoSizeAxes = Axes.Y, Child = component = new LabelledSliderBar <double> { Current = new BindableDouble(5) { MinValue = 0, MaxValue = 10, Precision = 1, } } }; component.Label = "a sample component"; component.Description = hasDescription ? "this text describes the component" : string.Empty; }); }
private void load() { Children = new[] { stackLeniency = new LabelledSliderBar <float> { Label = "Stack Leniency", Description = "In play mode, osu! automatically stacks notes which occur at the same location. Increasing this value means it is more likely to snap notes of further time-distance.", Current = new BindableFloat(Beatmap.BeatmapInfo.StackLeniency) { Default = 0.7f, MinValue = 0, MaxValue = 1, Precision = 0.1f } } }; }
private void load() { Children = new Drawable[] { new OsuSpriteText { Text = "Difficulty settings" }, circleSizeSlider = new LabelledSliderBar<float> { Label = "Object Size", Description = "The size of all hit objects", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 2, MaxValue = 7, Precision = 0.1f, } }, healthDrainSlider = new LabelledSliderBar<float> { Label = "Health Drain", Description = "The rate of passive health drain throughout playable time", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.DrainRate) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 0, MaxValue = 10, Precision = 0.1f, } }, approachRateSlider = new LabelledSliderBar<float> { Label = "Approach Rate", Description = "The speed at which objects are presented to the player", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.ApproachRate) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 0, MaxValue = 10, Precision = 0.1f, } }, overallDifficultySlider = new LabelledSliderBar<float> { Label = "Overall Difficulty", Description = "The harshness of hit windows and difficulty of special objects (ie. spinners)", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.OverallDifficulty) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 0, MaxValue = 10, Precision = 0.1f, } }, }; foreach (var item in Children.OfType<LabelledSliderBar<float>>()) item.Current.ValueChanged += onValueChanged; }
private void load() { Children = new Drawable[] { new OsuSpriteText { Text = "難度設定" }, circleSizeSlider = new LabelledSliderBar <float> { Label = "物件大小", Description = "所有可打擊物件的大小", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 0, MaxValue = 10, Precision = 0.1f, } }, healthDrainSlider = new LabelledSliderBar <float> { Label = "枯竭速度", Description = "遊戲中被動體力枯竭率", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.DrainRate) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 0, MaxValue = 10, Precision = 0.1f, } }, approachRateSlider = new LabelledSliderBar <float> { Label = "縮圈速度", Description = "以多快的速度出現在畫面中", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.ApproachRate) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 0, MaxValue = 10, Precision = 0.1f, } }, overallDifficultySlider = new LabelledSliderBar <float> { Label = "整體難度", Description = "打擊判定的嚴格性和部分特殊物件的難度 (比如轉盤)", Current = new BindableFloat(Beatmap.Value.BeatmapInfo.BaseDifficulty.OverallDifficulty) { Default = BeatmapDifficulty.DEFAULT_DIFFICULTY, MinValue = 0, MaxValue = 10, Precision = 0.1f, } }, }; foreach (var item in Children.OfType <LabelledSliderBar <float> >()) { item.Current.ValueChanged += onValueChanged; } }