private void load(RulesetStore rulesets) { Lyric = DemoKaraokeObject.GenerateDemo001(); DrawableKaraokeObject = new DrawableLyric(Lyric) { Position = new Vector2(), ProgressUpdateByTime = false, }; var slider = new SettingsSlider <double>() { LabelText = "Background dim ", Bindable = new BindableDouble { MinValue = 0, MaxValue = 500, Default = 300, Value = DrawableKaraokeObject.Progress, }, Width = 0.5f }; slider.Bindable.ValueChanged += (v) => { DrawableKaraokeObject.Progress = v; }; Children = new Drawable[] { slider, }; Add(DrawableKaraokeObject); }
public LyricPreview() { Size = new Vector2(0.7f, 0.5f); Child = drawableLyric = new DrawableLyric(createPreviewLyric()) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Clock = new StopClock(0), }; displayRuby.BindValueChanged(e => { drawableLyric.DisplayRuby = e.NewValue; }, true); displayRomaji.BindValueChanged(e => { drawableLyric.DisplayRomaji = e.NewValue; }, true); useTranslate.BindValueChanged(e => { updateTranslate(); }); translateLanguage.BindValueChanged(e => { updateTranslate(); }); void updateTranslate() { var translate = useTranslate.Value; var language = translateLanguage.Value; if (language != null) { drawableLyric.HitObject.Translates = new Dictionary <CultureInfo, string> { { language, language.DisplayName } }; } drawableLyric.DisplayTranslateLanguage = translate ? language : null; } }
public LyricSelectionBlueprint(DrawableLyric hitObject) : base(hitObject) { }