public OsuCheckbox()
        {
            AutoSizeAxes     = Axes.Y;
            RelativeSizeAxes = Axes.X;

            Children = new Drawable[]
            {
                labelSpriteText = new OsuSpriteText(),
                Nub             = new Nub
                {
                    Anchor = Anchor.CentreRight,
                    Origin = Anchor.CentreRight,
                    Margin = new MarginPadding {
                        Right = 5
                    },
                },
                new HoverClickSounds()
            };

            Nub.Current.BindTo(Current);

            Current.DisabledChanged += disabled =>
            {
                Alpha = disabled ? 0.3f : 1;
            };
        }
Beispiel #2
0
        public OsuSliderBar()
        {
            Height       = 12;
            RangePadding = 20;
            Children     = new Drawable[]
            {
                leftBox = new Box
                {
                    Height           = 2,
                    EdgeSmoothness   = new Vector2(0, 0.5f),
                    Position         = new Vector2(2, 0),
                    RelativeSizeAxes = Axes.None,
                    Anchor           = Anchor.CentreLeft,
                    Origin           = Anchor.CentreLeft,
                },
                rightBox = new Box
                {
                    Height           = 2,
                    EdgeSmoothness   = new Vector2(0, 0.5f),
                    Position         = new Vector2(-2, 0),
                    RelativeSizeAxes = Axes.None,
                    Anchor           = Anchor.CentreRight,
                    Origin           = Anchor.CentreRight,
                    Alpha            = 0.5f,
                },
                Nub = new Nub
                {
                    Origin   = Anchor.TopCentre,
                    Expanded = true,
                },
                new HoverClickSounds()
            };

            Current.DisabledChanged += disabled =>
            {
                Alpha = disabled ? 0.3f : 1;
            };
        }