Ejemplo n.º 1
0
            public OsuTabItem(T value) : base(value)
            {
                AutoSizeAxes     = Axes.X;
                RelativeSizeAxes = Axes.Y;

                Children = new Drawable[]
                {
                    Text = new OsuSpriteText
                    {
                        Margin = new MarginPadding {
                            Top = 5, Bottom = 5
                        },
                        Origin   = Anchor.BottomLeft,
                        Anchor   = Anchor.BottomLeft,
                        Text     = (value as IHasDescription)?.Description ?? (value as Enum)?.GetDescription() ?? value.ToString(),
                        TextSize = 14,
                    },
                    Bar = new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = 1,
                        Alpha            = 0,
                        Colour           = Color4.White,
                        Origin           = Anchor.BottomLeft,
                        Anchor           = Anchor.BottomLeft,
                    },
                    new HoverClickSounds()
                };

                Active.BindValueChanged(val => Text.Font = val ? @"Exo2.0-Bold" : @"Exo2.0", true);
            }
Ejemplo n.º 2
0
            public PageTabItem(T value)
                : base(value)
            {
                AutoSizeAxes     = Axes.X;
                RelativeSizeAxes = Axes.Y;

                Children = new Drawable[]
                {
                    Text = new OsuSpriteText
                    {
                        Margin = new MarginPadding {
                            Top = 8, Bottom = 8
                        },
                        Origin = Anchor.BottomLeft,
                        Anchor = Anchor.BottomLeft,
                        Text   = (value as Enum)?.GetDescription() ?? value.ToString(),
                        Font   = OsuFont.GetFont(size: 14)
                    },
                    box = new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = 5,
                        Scale            = new Vector2(1f, 0f),
                        Colour           = Color4.White,
                        Origin           = Anchor.BottomLeft,
                        Anchor           = Anchor.BottomLeft,
                    },
                    new HoverClickSounds()
                };

                Active.BindValueChanged(active => Text.Font = Text.Font.With(Typeface.Exo, weight: active.NewValue ? FontWeight.Bold : FontWeight.Medium), true);
            }
Ejemplo n.º 3
0
            public PageTabItem(T value) : base(value)
            {
                AutoSizeAxes     = Axes.X;
                RelativeSizeAxes = Axes.Y;

                Children = new Drawable[]
                {
                    Text = new OsuSpriteText
                    {
                        Margin = new MarginPadding {
                            Top = 8, Bottom = 8
                        },
                        Origin   = Anchor.BottomLeft,
                        Anchor   = Anchor.BottomLeft,
                        Text     = (value as Enum)?.GetDescription() ?? value.ToString(),
                        TextSize = 14,
                    },
                    box = new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = 5,
                        Scale            = new Vector2(1f, 0f),
                        Colour           = Color4.White,
                        Origin           = Anchor.BottomLeft,
                        Anchor           = Anchor.BottomLeft,
                    },
                    new HoverClickSounds()
                };

                Active.BindValueChanged(val => Text.Font = val ? @"Exo2.0-Bold" : @"Exo2.0", true);
            }
Ejemplo n.º 4
0
            public DesignerTabItem(T value) : base(value)
            {
                AutoSizeAxes     = Axes.X;
                RelativeSizeAxes = Axes.Y;

                InternalChildren = new Drawable[]
                {
                    _content = new FillFlowContainer
                    {
                        AutoSizeAxes     = Axes.X,
                        RelativeSizeAxes = Axes.Y,
                        Direction        = FillDirection.Horizontal,
                        Child            = _text = new SpriteText
                        {
                            Origin   = Anchor.CentreLeft,
                            Anchor   = Anchor.CentreLeft,
                            Text     = value.ToString(),
                            TextSize = 18,
                            Font     = "Nunito"
                        }
                    },
                    _bar = new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = 2,
                        Alpha            = 0,
                        Colour           = Color4.White,
                        Origin           = Anchor.BottomLeft,
                        Anchor           = Anchor.BottomLeft,
                    }
                };

                Active.BindValueChanged(a => _text.Font = a ? @"Nunito-Bold" : @"Nunito", runOnceImmediately: true);
            }
Ejemplo n.º 5
0
        protected override void LoadComplete()
        {
            base.LoadComplete();
            Active.BindValueChanged(_ =>
            {
                playStateChangeSamples();
                UpdateState();
            });

            UpdateState();
            FinishTransforms(true);
        }
Ejemplo n.º 6
0
 public LegacyCursorParticleSpewer(Texture texture, int perSecond)
     : base(texture, perSecond, particle_duration_max)
 {
     Active.BindValueChanged(_ => resetVelocityCalculation());
 }