Example #1
0
        public BackButton()
        {
            Size = TwoLayerButton.SIZE_EXTENDED;

            Child = button = new TwoLayerButton
            {
                Anchor = Anchor.CentreLeft,
                Origin = Anchor.CentreLeft,
                Text   = @"back",
                Icon   = OsuIcon.LeftCircle,
                Action = () => Action?.Invoke()
            };
        }
        public BackButton(Receptor receptor)
        {
            receptor.OnBackPressed = () => button.Click();

            Size = TwoLayerButton.SIZE_EXTENDED;

            Child = button = new TwoLayerButton
            {
                Anchor = Anchor.TopLeft,
                Origin = Anchor.TopLeft,
                Text   = @"back",
                Icon   = OsuIcon.LeftCircle,
                Action = () => Action?.Invoke()
            };
        }
Example #3
0
        public BackButton(Receptor receptor = null)
        {
            Size = TwoLayerButton.SIZE_EXTENDED;

            Child = button = new TwoLayerButton
            {
                Anchor = Anchor.TopLeft,
                Origin = Anchor.TopLeft,
                Text   = @"back",
                Icon   = OsuIcon.LeftCircle,
                Action = () => Action?.Invoke()
            };

            if (receptor == null)
            {
                // if a receptor wasn't provided, create our own locally.
                Add(receptor = new Receptor());
            }

            receptor.OnBackPressed = () => button.TriggerClick();
        }