public TextContainer() { Anchor = Anchor.CentreLeft; Origin = Anchor.CentreLeft; AutoSizeAxes = Axes.Both; Children = new Drawable[] { NormalText = new SpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = RhythmicFont.GetFont(size: text_size), Margin = new MarginPadding { Horizontal = margin_horizontal, Vertical = MARGIN_VERTICAL }, }, BoldText = new SpriteText { AlwaysPresent = true, Alpha = 0, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = RhythmicFont.GetFont(size: text_size, weight: FontWeight.SemiBold), Margin = new MarginPadding { Horizontal = margin_horizontal, Vertical = MARGIN_VERTICAL }, } }; }
protected override SpriteText CreatePlaceholder() => new SpriteText { Font = RhythmicFont.GetFont(italics: true), Colour = new Color4(180, 180, 180, 255), Margin = new MarginPadding { Left = 2 }, };
private void Refresh() { flow.Clear(); flow.Add(new SpriteText { Text = @"the quick red fox jumps over the lazy brown dog", Font = RhythmicFont.GetFont(TypeFace, 60, Weight, Italics) }); flow.Add(new SpriteText { Text = @"THE QUICK RED FOX JUMPS OVER THE LAZY BROWN DOG", Font = RhythmicFont.GetFont(TypeFace, 60, Weight, Italics) }); flow.Add(new SpriteText { Text = @"0123456789!@#$%^&*()_-+-[]{}.,<>;'\", Font = RhythmicFont.GetFont(TypeFace, 60, Weight, Italics) }); }
private void load() { Children = new Drawable[] { dragContainer = new DragContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { playlist = new PlaylistOverlay(screen) { RelativeSizeAxes = Axes.X, Y = player_height + 10, OrderChanged = playlistOrderChanged }, playerContainer = new Container { RelativeSizeAxes = Axes.X, Height = player_height, Masking = true, CornerRadius = 5, EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(40), Type = EdgeEffectType.Shadow, Offset = new Vector2(0, 2), Radius = 5, }, Children = new[] { background = new Background(), title = new SpriteText { Origin = Anchor.BottomLeft, Anchor = Anchor.TopLeft, Position = new Vector2(10, 40), Font = RhythmicFont.GetFont(size: 30, weight: FontWeight.SemiBold), Colour = Color4.White, Text = @"Nothing to play", }, artist = new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Position = new Vector2(10, 45), Font = RhythmicFont.GetFont(size: 20), Colour = Color4.White, Text = @"Nothing to play", }, new Container { Padding = new MarginPadding { Bottom = progress_height }, Height = bottom_black_area_height, RelativeSizeAxes = Axes.X, Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Children = new Drawable[] { new FillFlowContainer <IconButton> { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5), Origin = Anchor.Centre, Anchor = Anchor.Centre, Children = new[] { prevButton = new MusicIconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = prev, Icon = FontAwesome.Solid.StepBackward, }, playButton = new MusicIconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(1.4f), IconScale = new Vector2(1.4f), Action = play, Icon = FontAwesome.Regular.PlayCircle, }, nextButton = new MusicIconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = () => next(), Icon = FontAwesome.Solid.StepForward, }, } }, playlistButton = new MusicIconButton { Origin = Anchor.Centre, Anchor = Anchor.CentreRight, Position = new Vector2(-bottom_black_area_height / 2, 0), Icon = FontAwesome.Solid.Bars, Action = () => playlist.ToggleVisibility(), }, } }, progressBar = new ProgressBar { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = RhythmicColors.Orange, OnSeek = attemptSeek } }, }, } } }; playlist.State.ValueChanged += s => playlistButton.FadeColour(s.NewValue == Visibility.Visible ? RhythmicColors.Orange : Color4.White, 200, Easing.OutQuint); }
private void load() { const int line_offset = 80; Rotation = -45; Children = new Drawable[] { lines = new Container <Box> { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Children = new[] { lineTopLeft = new Box { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, Position = new Vector2(-line_offset, -line_offset), Rotation = 45, Colour = Color4.White.Opacity(180), }, lineTopRight = new Box { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, Position = new Vector2(line_offset, -line_offset), Rotation = -45, Colour = Color4.White.Opacity(80), }, lineBottomLeft = new Box { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, Position = new Vector2(-line_offset, line_offset), Rotation = -45, Colour = Color4.White.Opacity(230), }, lineBottomRight = new Box { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, Position = new Vector2(line_offset, line_offset), Rotation = 45, Colour = Color4.White.Opacity(130), }, } }, bigRing = new Ring(RhythmicColors.FromHex(@"B6C5E9"), 0.85f), mediumRing = new Ring(Color4.White.Opacity(130), 0.7f), smallRing = new Ring(Color4.White, 0.6f), welcomeText = new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "welcome", Padding = new MarginPadding { Bottom = 10 }, Font = RhythmicFont.GetFont(size: 74), Alpha = 0, Spacing = new Vector2(5), }, new CircularContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(logo_size), Masking = true, Children = new Drawable[] { backgroundFill = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Height = 0, Colour = RhythmicColors.FromHex(@"C6D8FF").Opacity(160), }, foregroundFill = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = Vector2.Zero, RelativeSizeAxes = Axes.Both, Width = 0, Colour = Color4.White, }, } } }; foreach (Box line in lines) { line.Size = new Vector2(105, 1.5f); line.Alpha = 0; } Scale = new Vector2(0.5f); }
public DialogButton() { RelativeSizeAxes = Axes.X; Children = new Drawable[] { backgroundContainer = new Container { RelativeSizeAxes = Axes.Both, Width = 1f, Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour, }, }, }, glowContainer = new Container { RelativeSizeAxes = Axes.Both, Width = 1f, Alpha = 0f, Children = new Drawable[] { leftGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Width = 0.125f, }, centerGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = 0.75f, }, rightGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopRight, Anchor = Anchor.TopRight, Width = 0.125f, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Masking = true, Children = new Drawable[] { colourContainer = new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = 0.8f, Masking = true, MaskingSmoothness = 2, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.2f), Radius = 5, }, Colour = ButtonColour, Shear = new Vector2(0.2f, 0), Children = new Drawable[] { new Box { EdgeSmoothness = new Vector2(2, 0), RelativeSizeAxes = Axes.Both, }, }, }, }, }, spriteText = new SpriteText { Text = Text, Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = RhythmicFont.GetFont(size: 28, weight: FontWeight.Bold), Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.1f), Colour = Color4.White, }, }; updateGlow(); Selected.ValueChanged += selectionChanged; }
public BeatmapCard(BeatmapMeta beatmap) { Beatmap = beatmap; Size = size; CornerRadius = 5; Masking = true; EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Offset = new Vector2(0f, 2f), Radius = 1f, Colour = Color4.Black.Opacity(0.25f), }; Children = new Drawable[] { main = new BufferedContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black }, new BeatmapBackgroundSprite(beatmap) { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0.6f, }, new Box { RelativeSizeAxes = Axes.Both, Colour = new ColourInfo { TopLeft = Color4.Black.Opacity(0f), TopRight = Color4.Black.Opacity(0f), BottomLeft = Color4.Black.Opacity(0.6f), BottomRight = Color4.Black.Opacity(0.6f) } }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Padding = new MarginPadding { Bottom = size.Y / 4 + 5, Left = 5 }, Children = new Drawable[] { new SpriteText { Text = beatmap.Metadata.Song.Author, Font = RhythmicFont.GetFont(size: 20, weight: FontWeight.Light), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, new SpriteText { Text = beatmap.Metadata.Song.Name, Font = RhythmicFont.GetFont(size: 30, weight: FontWeight.Regular), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft } } }, } }, new BeatmapUsecase(beatmap, main) { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, Size = new Vector2(1f, size.Y / 4) } }; }
private void load() { Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = background_alpha, }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 50), Origin = Anchor.Centre, Anchor = Anchor.Centre, Children = new Drawable[] { new FillFlowContainer { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Children = new Drawable[] { new SpriteText { Text = Header, Font = RhythmicFont.GetFont(size: 30), Spacing = new Vector2(5, 0), Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Colour = RhythmicColors.Orange, Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.25f) }, new SpriteText { Text = Description, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.25f) } } }, InternalButtons = new FillFlowContainer <DialogButton> { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Masking = true, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.6f), Radius = 50 }, }, retryCounterContainer = new FillFlowContainer { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, AutoSizeAxes = Axes.Both, } } }, }; updateRetryCount(); }
public ScreenWhiteBox() { InternalChildren = new Drawable[] { boxContainer = new Container { Size = new Vector2(0.3f), RelativeSizeAxes = Axes.Both, CornerRadius = 20, Masking = true, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = getColourFor(GetType()), Alpha = 0.2f, Blending = BlendingMode.Additive, }, textContainer = new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteIcon { Icon = FontAwesome.Solid.UniversalAccess, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Size = new Vector2(50), }, header = new SpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = GetType().Name, Colour = getColourFor(GetType()).Lighten(0.8f), Font = RhythmicFont.GetFont(size: 70, italics: true), }, new SpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = "is not yet ready for use!", Font = RhythmicFont.GetFont(size: 30), }, new SpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = "please check back a bit later.", Font = RhythmicFont.GetFont(size: 22), }, } }, } }, popButton = new BackButton { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Alpha = 0, Action = this.Exit } }; }
protected override Drawable GetDrawableCharacter(char c) => new SpriteText { Text = c.ToString(), Font = RhythmicFont.GetFont(size: CalculatedTextSize) };