static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular);
private void load(BeatmapManager manager, SongSelect songSelect) { Header.Height = height; if (songSelect != null) { startRequested = b => songSelect.FinaliseSelection(b); if (songSelect.AllowEditing) { editRequested = songSelect.Edit; } } if (manager != null) { hideRequested = manager.Hide; } Header.Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, }, triangles = new Triangles { TriangleScale = 2, RelativeSizeAxes = Axes.Both, ColourLight = Colour4Extensions.FromHex(@"3a7285"), ColourDark = Colour4Extensions.FromHex(@"123744") }, new FillFlowContainer { Padding = new MarginPadding(5), Direction = FillDirection.Horizontal, AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Children = new Drawable[] { new DifficultyIcon(beatmapInfo, shouldShowTooltip: false) { Scale = new Vector2(1.8f), }, new FillFlowContainer { Padding = new MarginPadding { Left = 5 }, Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Both, Children = new Drawable[] { new FillFlowContainer { Direction = FillDirection.Horizontal, Spacing = new Vector2(4, 0), AutoSizeAxes = Axes.Both, Children = new[] { new OsuSpriteText { Text = beatmapInfo.Version, Font = OsuFont.GetFont(size: 20), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, new OsuSpriteText { Text = "mapped by", Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, new OsuSpriteText { Text = $"{(beatmapInfo.Metadata ?? beatmapInfo.BeatmapSet.Metadata).Author.Username}", Font = OsuFont.GetFont(italics: true), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, } }, new FillFlowContainer { Direction = FillDirection.Horizontal, Spacing = new Vector2(4, 0), AutoSizeAxes = Axes.Both, Children = new Drawable[] { new TopLocalRank(beatmapInfo) { Scale = new Vector2(0.8f), Size = new Vector2(40, 20) }, starCounter = new StarCounter { Scale = new Vector2(0.8f), } } } } } } } }; }
public HeaderText(string text) { Text = text.ToUpper(); Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold); }
private void load(APIAccess api, BeatmapManager beatmaps) { FillFlowContainer textSprites; AddRangeInternal(new Drawable[] { shakeContainer = new ShakeContainer { Depth = -1, RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 5, Children = new Drawable[] { button = new HeaderButton { RelativeSizeAxes = Axes.Both }, new Container { // cannot nest inside here due to the structure of button (putting things in its own content). // requires framework fix. Padding = new MarginPadding { Horizontal = 10 }, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { textSprites = new FillFlowContainer { Depth = -1, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, AutoSizeDuration = 500, AutoSizeEasing = Easing.OutQuint, Direction = FillDirection.Vertical, }, new SpriteIcon { Depth = -1, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Icon = FontAwesome.fa_download, Size = new Vector2(16), Margin = new MarginPadding { Right = 5 }, }, } }, new DownloadProgressBar(BeatmapSet.Value) { Depth = -2, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, }, }, }, }); button.Action = () => { if (State.Value != DownloadState.NotDownloaded) { shakeContainer.Shake(); return; } beatmaps.Download(BeatmapSet.Value, noVideo); }; localUser.BindTo(api.LocalUser); localUser.BindValueChanged(userChanged, true); button.Enabled.BindValueChanged(enabledChanged, true); State.BindValueChanged(state => { switch (state.NewValue) { case DownloadState.Downloading: textSprites.Children = new Drawable[] { new OsuSpriteText { Text = "Downloading...", Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold) }, }; break; case DownloadState.Downloaded: textSprites.Children = new Drawable[] { new OsuSpriteText { Text = "Importing...", Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold) }, }; break; case DownloadState.LocallyAvailable: this.FadeOut(200); break; case DownloadState.NotDownloaded: textSprites.Children = new Drawable[] { new OsuSpriteText { Text = "Download", Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold) }, new OsuSpriteText { Text = BeatmapSet.Value.OnlineInfo.HasVideo && noVideo ? "without Video" : string.Empty, Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold) }, }; this.FadeIn(200); break; } }, true); }
public TopScoreUserSection() { AutoSizeAxes = Axes.Both; InternalChild = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10, 0), Children = new Drawable[] { new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { rankText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold) }, rank = new UpdateableRank(ScoreRank.D) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(28), FillMode = FillMode.Fit, }, } }, avatar = new UpdateableAvatar(showGuestOnNull: false) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(70), Masking = true, CornerRadius = 4, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Colour4.Black.Opacity(0.25f), Offset = new Vector2(0, 2), Radius = 1, }, }, new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 3), Children = new Drawable[] { usernameText = new LinkFlowContainer(s => s.Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true)) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Children = new[] { new OsuSpriteText { Text = "achieved ", Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold) }, achievedOn = new DrawableDate(DateTimeOffset.MinValue) { Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold) }, } }, flag = new UpdateableFlag { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Size = new Vector2(19, 13), Margin = new MarginPadding { Top = 3 }, // makes spacing look more even ShowPlaceholderOnNull = false, }, } } } }; }
protected override Drawable CreateHeaderText() => new OsuSpriteText { Text = @"osu!direct", Font = OsuFont.GetFont(size: 25) };
public Header() { ExternalLinkButton externalLink; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Masking = true; EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.25f), Type = EdgeEffectType.Shadow, Radius = 3, Offset = new Vector2(0f, 1f), }; InternalChild = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { beatmapSetHeader = new BeatmapSetHeader { Ruleset = { BindTarget = ruleset }, }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { cover = new UpdateableBeatmapSetCover { RelativeSizeAxes = Axes.Both, Masking = true, }, coverGradient = new Box { RelativeSizeAxes = Axes.Both }, }, }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Vertical = BeatmapSetOverlay.Y_PADDING, Left = BeatmapSetOverlay.X_PADDING, Right = BeatmapSetOverlay.X_PADDING + BeatmapSetOverlay.RIGHT_WIDTH, }, Children = new Drawable[] { fadeContent = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Child = Picker = new BeatmapPicker(), }, new FillFlowContainer { Direction = FillDirection.Horizontal, AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Top = 15 }, Children = new Drawable[] { title = new OsuSpriteText { Font = OsuFont.GetFont(size: 30, weight: FontWeight.SemiBold, italics: true) }, externalLink = new ExternalLinkButton { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Margin = new MarginPadding { Left = 3, Bottom = 4 }, //To better lineup with the font }, } }, artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium, italics: true) }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Margin = new MarginPadding { Top = 20 }, Child = author = new AuthorInfo(), }, beatmapAvailability = new BeatmapAvailability(), new Container { RelativeSizeAxes = Axes.X, Height = buttons_height, Margin = new MarginPadding { Top = 10 }, Children = new Drawable[] { favouriteButton = new FavouriteButton { BeatmapSet = { BindTarget = BeatmapSet } }, downloadButtonsContainer = new FillFlowContainer { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = buttons_height + buttons_spacing }, Spacing = new Vector2(buttons_spacing), }, }, }, }, }, } }, loading = new LoadingAnimation { Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(1.5f), }, new FillFlowContainer { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Top = BeatmapSetOverlay.Y_PADDING, Right = BeatmapSetOverlay.X_PADDING }, Direction = FillDirection.Vertical, Spacing = new Vector2(10), Children = new Drawable[] { onlineStatusPill = new BeatmapSetOnlineStatusPill { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, TextSize = 14, TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 } }, Details = new Details(), }, }, }, }, } }; Picker.Beatmap.ValueChanged += b => { Details.Beatmap = b.NewValue; externalLink.Link = $@"https://osu.ppy.sh/beatmapsets/{BeatmapSet.Value?.OnlineBeatmapSetID}#{b.NewValue?.Ruleset.ShortName}/{b.NewValue?.OnlineBeatmapID}"; }; }
private void load(OsuColour colours) { InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4Extensions.FromHex(@"28242d"), }, new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Distributed), new Dimension(GridSizeMode.AutoSize), }, Content = new[] { new Drawable[] { new OsuScrollContainer { Padding = new MarginPadding { Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING, Vertical = 10 }, RelativeSizeAxes = Axes.Both, Children = new[] { new Container { Padding = new MarginPadding { Horizontal = WaveOverlayContainer.WIDTH_PADDING }, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { new SectionContainer { Padding = new MarginPadding { Right = FIELD_PADDING / 2 }, Children = new[] { new Section("Room name") { Child = NameField = new SettingsTextBox { RelativeSizeAxes = Axes.X, TabbableContentContainer = this, LengthLimit = 100 }, }, new Section("Duration") { Child = DurationField = new DurationDropdown { RelativeSizeAxes = Axes.X, Items = new[] { TimeSpan.FromMinutes(30), TimeSpan.FromHours(1), TimeSpan.FromHours(2), TimeSpan.FromHours(4), TimeSpan.FromHours(8), TimeSpan.FromHours(12), //TimeSpan.FromHours(16), TimeSpan.FromHours(24), TimeSpan.FromDays(3), TimeSpan.FromDays(7) } } }, new Section("Room visibility") { Alpha = disabled_alpha, Child = AvailabilityPicker = new RoomAvailabilityPicker { Enabled = { Value = false } }, }, new Section("Game type") { Alpha = disabled_alpha, Child = new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, Spacing = new Vector2(7), Children = new Drawable[] { TypePicker = new GameTypePicker { RelativeSizeAxes = Axes.X, Enabled = { Value = false } }, typeLabel = new OsuSpriteText { Font = OsuFont.GetFont(size: 14), Colour = colours.Yellow }, }, }, }, new Section("Max participants") { Alpha = disabled_alpha, Child = MaxParticipantsField = new SettingsNumberTextBox { RelativeSizeAxes = Axes.X, TabbableContentContainer = this, ReadOnly = true, }, }, new Section("Password (optional)") { Alpha = disabled_alpha, Child = new SettingsPasswordTextBox { RelativeSizeAxes = Axes.X, TabbableContentContainer = this, ReadOnly = true, }, }, }, }, new SectionContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Padding = new MarginPadding { Left = FIELD_PADDING / 2 }, Children = new[] { new Section("Playlist") { Child = new GridContainer { RelativeSizeAxes = Axes.X, Height = 300, Content = new[] { new Drawable[] { playlist = new DrawableRoomPlaylist(true, true) { RelativeSizeAxes = Axes.Both } }, new Drawable[] { playlistLength = new OsuSpriteText { Margin = new MarginPadding { Vertical = 5 }, Colour = colours.Yellow, Font = OsuFont.GetFont(size: 12), } }, new Drawable[] { new PurpleTriangleButton { RelativeSizeAxes = Axes.X, Height = 40, Text = "Edit playlist", Action = () => EditPlaylist?.Invoke() } } }, RowDimensions = new[] { new Dimension(), new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize), } } }, }, }, }, } }, }, }, new Drawable[] { new Container { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Y = 2, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4Extensions.FromHex(@"28242d").Darken(0.5f).Opacity(1f), }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Vertical = 20 }, Padding = new MarginPadding { Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Children = new Drawable[] { ApplyButton = new CreateRoomButton { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Size = new Vector2(230, 55), Enabled = { Value = false }, Action = apply, }, ErrorText = new OsuSpriteText { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Alpha = 0, Depth = 1, Colour = colours.RedDark } } } } } } } }, loadingLayer = new LoadingLayer(true) }; TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue?.Name ?? string.Empty, true); RoomName.BindValueChanged(name => NameField.Text = name.NewValue, true); Availability.BindValueChanged(availability => AvailabilityPicker.Current.Value = availability.NewValue, true); Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true); MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true); Duration.BindValueChanged(duration => DurationField.Current.Value = duration.NewValue ?? TimeSpan.FromMinutes(30), true); playlist.Items.BindTo(Playlist); Playlist.BindCollectionChanged(onPlaylistChanged, true); }
public ModSelectOverlay() { Waves.FirstWaveColour = OsuColour.FromHex(@"19b0e2"); Waves.SecondWaveColour = OsuColour.FromHex(@"2280a2"); Waves.ThirdWaveColour = OsuColour.FromHex(@"005774"); Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e"); Height = 510; Padding = new MarginPadding { Horizontal = -OsuScreen.HORIZONTAL_OVERFLOW_PADDING }; Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Color4(36, 50, 68, 255) }, new Triangles { TriangleScale = 5, RelativeSizeAxes = Axes.X, Height = Height, //set the height from the start to ensure correct triangle density. ColourLight = new Color4(53, 66, 82, 255), ColourDark = new Color4(41, 54, 70, 255), }, }, }, new GridContainer { RelativeSizeAxes = Axes.Both, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, RowDimensions = new[] { new Dimension(GridSizeMode.Absolute, 90), new Dimension(GridSizeMode.Distributed), new Dimension(GridSizeMode.Absolute, 70), }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(10).Opacity(100), }, new FillFlowContainer { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Width = content_width, Padding = new MarginPadding { Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Children = new Drawable[] { new OsuSpriteText { Text = @"Gameplay Mods", Font = OsuFont.GetFont(size: 22, weight: FontWeight.Bold), Shadow = true, Margin = new MarginPadding { Bottom = 4, }, }, new OsuTextFlowContainer(text => { text.Font = text.Font.With(size: 18); text.Shadow = true; }) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Text = "Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play.\nOthers are just for fun.", }, }, }, }, }, }, new Drawable[] { // Body new OsuScrollContainer { ScrollbarVisible = false, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = 10, Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Child = ModSectionsContainer = new FillFlowContainer <ModSection> { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(0f, 10f), Width = content_width, Children = new ModSection[] { new DifficultyReductionSection { Action = modButtonPressed }, new DifficultyIncreaseSection { Action = modButtonPressed }, new AutomationSection { Action = modButtonPressed }, new ConversionSection { Action = modButtonPressed }, new FunSection { Action = modButtonPressed }, } }, }, }, new Drawable[] { // Footer new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Color4(172, 20, 116, 255), Alpha = 0.5f, }, footerContainer = new FillFlowContainer { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Width = content_width, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Vertical = 15, Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Children = new Drawable[] { DeselectAllButton = new TriangleButton { Width = 180, Text = "Deselect All", Action = DeselectAll, Margin = new MarginPadding { Right = 20 } }, new OsuSpriteText { Text = @"Score Multiplier:", Font = OsuFont.GetFont(size: 30), Margin = new MarginPadding { Top = 5, Right = 10 } }, MultiplierLabel = new OsuSpriteText { Font = OsuFont.GetFont(size: 30, weight: FontWeight.Bold), Margin = new MarginPadding { Top = 5 } }, UnrankedLabel = new OsuSpriteText { Text = @"(Unranked)", Font = OsuFont.GetFont(size: 30, weight: FontWeight.Bold), Margin = new MarginPadding { Top = 5, Left = 10 } } } } }, } }, }, }, }; }
protected FillFlowContainer CreateStatusMessage(bool rightAlignedChildren) { var statusContainer = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical }; var alignment = rightAlignedChildren ? Anchor.CentreRight : Anchor.CentreLeft; statusContainer.Add(LastVisitMessage = new TextFlowContainer(t => t.Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold)).With(text => { text.Anchor = alignment; text.Origin = alignment; text.AutoSizeAxes = Axes.Both; text.Alpha = 0; if (User.LastVisit.HasValue) { text.AddText(@"Last seen "); text.AddText(new DrawableDate(User.LastVisit.Value, italic: false) { Shadow = false }); } })); statusContainer.Add(statusMessage = new OsuSpriteText { Anchor = alignment, Origin = alignment, Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold) }); return(statusContainer); }
private void load() { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Masking = true; CornerRadius = 6; NewsBackground bg; InternalChildren = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background4 }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.X, Height = 160, Masking = true, CornerRadius = 6, Children = new Drawable[] { new DelayedLoadWrapper(bg = new NewsBackground(post.FirstImage) { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0 }) { RelativeSizeAxes = Axes.Both }, new DateContainer(post.PublishedAt) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Margin = new MarginPadding { Top = 10, Right = 15 } } } }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Horizontal = 15, Vertical = 10 }, Child = main = new TextFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y } } } }, new HoverClickSounds() }; bg.OnLoadComplete += d => d.FadeIn(250, Easing.In); main.AddParagraph(post.Title, t => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold)); main.AddParagraph(post.Preview, t => t.Font = OsuFont.GetFont(size: 12)); // Should use sans-serif font main.AddParagraph("by ", t => t.Font = OsuFont.GetFont(size: 12)); main.AddText(post.Author, t => t.Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold)); }
private void load(OsuColour colours) { Children = new Drawable[] { dragContainer = new DragContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { playlist = new PlaylistOverlay { RelativeSizeAxes = Axes.X, Y = player_height + 10, }, playerContainer = new Container { RelativeSizeAxes = Axes.X, Height = player_height, Masking = true, CornerRadius = 5, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(40), Radius = 5, }, Children = new[] { background = new Background(), title = new OsuSpriteText { Origin = Anchor.BottomCentre, Anchor = Anchor.TopCentre, Position = new Vector2(0, 40), Font = OsuFont.GetFont(size: 25, italics: true), Colour = Color4.White, Text = @"Nothing to play", }, artist = new OsuSpriteText { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Position = new Vector2(0, 45), Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold, italics: true), 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 = () => musicController.PreviousTrack(), Icon = FontAwesome.Solid.StepBackward, }, playButton = new MusicIconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(1.4f), IconScale = new Vector2(1.4f), Action = () => musicController.TogglePause(), Icon = FontAwesome.Regular.PlayCircle, }, nextButton = new MusicIconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = () => musicController.NextTrack(), 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 HoverableProgressBar { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Height = progress_height / 2, FillColour = colours.Yellow, BackgroundColour = colours.YellowDarker.Opacity(0.5f), OnSeek = musicController.SeekTo } }, }, } } }; playlist.State.ValueChanged += s => playlistButton.FadeColour(s.NewValue == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); }
private void load(OsuColour colours, IBindable <RulesetInfo> parentRuleset, OsuConfigManager config) { sortMode = config.GetBindable <SortMode>(OsuSetting.SongSelectSortingMode); groupMode = config.GetBindable <GroupMode>(OsuSetting.SongSelectGroupingMode); Children = new Drawable[] { new Box { Colour = Color4.Black, Alpha = 0.8f, Width = 2, RelativeSizeAxes = Axes.Both, }, new Container { Padding = new MarginPadding(side_margin), RelativeSizeAxes = Axes.Both, Width = 0.5f, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, // Reverse ChildID so that dropdowns in the top section appear on top of the bottom section. Child = new ReverseChildIDFillFlowContainer <Drawable> { RelativeSizeAxes = Axes.Both, Spacing = new Vector2(0, 5), Children = new[] { new Container { RelativeSizeAxes = Axes.X, Height = 60, Children = new Drawable[] { searchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X }, new Box { RelativeSizeAxes = Axes.X, Height = 1, Colour = OsuColour.Gray(80), Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, }, new FillFlowContainer { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(OsuTabControl <SortMode> .HORIZONTAL_SPACING, 0), Children = new Drawable[] { new OsuTabControlCheckbox { Text = "Show converted", Current = config.GetBindable <bool>(OsuSetting.ShowConvertedBeatmaps), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, }, sortTabs = new OsuTabControl <SortMode> { RelativeSizeAxes = Axes.X, Width = 0.5f, Height = 24, AutoSort = true, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, AccentColour = colours.GreenLight, Current = { BindTarget = sortMode } }, new OsuSpriteText { Text = "Sort by", Font = OsuFont.GetFont(size: 14), Margin = new MarginPadding(5), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, }, } }, } }, new Container { RelativeSizeAxes = Axes.X, Height = 20, Children = new Drawable[] { collectionDropdown = new CollectionFilterDropdown { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.X, Width = 0.4f, } } }, } } } }; config.BindWith(OsuSetting.ShowConvertedBeatmaps, showConverted); showConverted.ValueChanged += _ => updateCriteria(); config.BindWith(OsuSetting.DisplayStarsMinimum, minimumStars); minimumStars.ValueChanged += _ => updateCriteria(); config.BindWith(OsuSetting.DisplayStarsMaximum, maximumStars); maximumStars.ValueChanged += _ => updateCriteria(); ruleset.BindTo(parentRuleset); ruleset.BindValueChanged(_ => updateCriteria()); groupMode.BindValueChanged(_ => updateCriteria()); sortMode.BindValueChanged(_ => updateCriteria()); collectionDropdown.Current.ValueChanged += val => { if (val.NewValue == null) { // may be null briefly while menu is repopulated. return; } updateCriteria(); }; searchTextBox.Current.ValueChanged += _ => updateCriteria(); updateCriteria(); }
static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold);
protected OsuSpriteText CreateUsername() => new OsuSpriteText { Font = OsuFont.GetFont(size: 16, weight: FontWeight.Bold), Shadow = false, Text = User.Username, };
protected Toast(string description, string value, string shortcut) { Anchor = Anchor.Centre; Origin = Anchor.Centre; // A toast's height is decided (and transformed) by the containing OnScreenDisplay. RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; InternalChildren = new Drawable[] { new Container // this container exists just to set a minimum width for the toast { Anchor = Anchor.Centre, Origin = Anchor.Centre, Width = toast_minimum_width }, new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.7f }, content = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, }, new OsuSpriteText { Padding = new MarginPadding(10), Name = "Description", Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold), Spacing = new Vector2(1, 0), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = description.ToUpperInvariant() }, ValueText = new OsuSpriteText { Font = OsuFont.GetFont(size: 24, weight: FontWeight.Light), Padding = new MarginPadding { Left = 10, Right = 10 }, Name = "Value", Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = value }, ShortcutText = new OsuSpriteText { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Name = "Shortcut", Alpha = 0.3f, Margin = new MarginPadding { Bottom = 15 }, Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold), Text = string.IsNullOrEmpty(shortcut) ? "NO KEY BOUND" : shortcut.ToUpperInvariant() }, }; }
private void load() { const int line_offset = 80; const int circle_offset = 250; Children = new Drawable[] { lines = new Container <Box> { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = 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(OsuColour.FromHex(@"B6C5E9"), 0.85f), mediumRing = new Ring(Color4.White.Opacity(130), 0.7f), smallRing = new Ring(Color4.White, 0.6f), welcomeText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "欢迎", Padding = new MarginPadding { Bottom = 10 }, Font = OsuFont.GetFont(weight: FontWeight.Light, size: 120), 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 = OsuColour.FromHex(@"C6D8FF").Opacity(160), }, foregroundFill = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = Vector2.Zero, RelativeSizeAxes = Axes.Both, Width = 0, Colour = Color4.White, }, } }, purpleCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.TopCentre, Position = new Vector2(0, circle_offset), Colour = OsuColour.FromHex(@"AA92FF"), }, blueCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.CentreRight, Position = new Vector2(-circle_offset, 0), Colour = OsuColour.FromHex(@"8FE5FE"), }, yellowCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.BottomCentre, Position = new Vector2(0, -circle_offset), Colour = OsuColour.FromHex(@"FFD64C"), }, pinkCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.CentreLeft, Position = new Vector2(circle_offset, 0), Colour = OsuColour.FromHex(@"e967a1"), }, }; foreach (var line in lines) { line.Size = new Vector2(105, 1.5f); line.Alpha = 0; } Scale = new Vector2(0.5f); }
private OsuSpriteText createIndexDrawable(int index) => new RowText { Text = (index + 1).ToLocalisableString(@"\##"), Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.SemiBold) };
private void load() { if (hitEvents == null || hitEvents.Count == 0) { return; } int[] bins = new int[total_timing_distribution_bins]; double binSize = Math.Ceiling(hitEvents.Max(e => Math.Abs(e.TimeOffset)) / timing_distribution_bins); // Prevent div-by-0 by enforcing a minimum bin size binSize = Math.Max(1, binSize); foreach (var e in hitEvents) { int binOffset = (int)Math.Round(e.TimeOffset / binSize, MidpointRounding.AwayFromZero); bins[timing_distribution_centre_bin_index + binOffset]++; } int maxCount = bins.Max(); var bars = new Drawable[total_timing_distribution_bins]; for (int i = 0; i < bars.Length; i++) { bars[i] = new Bar { Height = Math.Max(0.05f, (float)bins[i] / maxCount) } } ; Container axisFlow; InternalChild = new GridContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Width = 0.8f, Content = new[] { new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { bars } } }, new Drawable[] { axisFlow = new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y } }, }, RowDimensions = new[] { new Dimension(), new Dimension(GridSizeMode.AutoSize), } }; // Our axis will contain one centre element + 5 points on each side, each with a value depending on the number of bins * bin size. double maxValue = timing_distribution_bins * binSize; double axisValueStep = maxValue / axis_points; axisFlow.Add(new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "0", Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold) }); for (int i = 1; i <= axis_points; i++) { double axisValue = i * axisValueStep; float position = (float)(axisValue / maxValue); float alpha = 1f - position * 0.8f; axisFlow.Add(new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativePositionAxes = Axes.X, X = -position / 2, Alpha = alpha, Text = axisValue.ToString("-0"), Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold) }); axisFlow.Add(new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativePositionAxes = Axes.X, X = position / 2, Alpha = alpha, Text = axisValue.ToString("+0"), Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold) }); } }
public ModSelectOverlay(Func <Mod, bool> isValidMod = null) { this.isValidMod = isValidMod ?? (m => true); Waves.FirstWaveColour = Color4Extensions.FromHex(@"19b0e2"); Waves.SecondWaveColour = Color4Extensions.FromHex(@"2280a2"); Waves.ThirdWaveColour = Color4Extensions.FromHex(@"005774"); Waves.FourthWaveColour = Color4Extensions.FromHex(@"003a4e"); RelativeSizeAxes = Axes.Both; Padding = new MarginPadding { Horizontal = -OsuScreen.HORIZONTAL_OVERFLOW_PADDING }; Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Color4(36, 50, 68, 255) }, new Triangles { TriangleScale = 5, RelativeSizeAxes = Axes.Both, ColourLight = new Color4(53, 66, 82, 255), ColourDark = new Color4(41, 54, 70, 255), }, }, }, new GridContainer { RelativeSizeAxes = Axes.Both, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, RowDimensions = new[] { new Dimension(GridSizeMode.Absolute, 90), new Dimension(GridSizeMode.Distributed), new Dimension(GridSizeMode.AutoSize), }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(10).Opacity(100), }, new FillFlowContainer { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Width = content_width, Padding = new MarginPadding { Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Children = new Drawable[] { new OsuSpriteText { Text = @"Gameplay Mods", Font = OsuFont.GetFont(size: 22, weight: FontWeight.Bold), Shadow = true, Margin = new MarginPadding { Bottom = 4, }, }, new OsuTextFlowContainer(text => { text.Font = text.Font.With(size: 18); text.Shadow = true; }) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Text = "Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play.\nOthers are just for fun.", }, }, }, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { // Body new OsuScrollContainer { ScrollbarVisible = false, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = 10, Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Children = new Drawable[] { ModSectionsContainer = new FillFlowContainer <ModSection> { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(0f, 10f), Width = content_width, LayoutDuration = 200, LayoutEasing = Easing.OutQuint, Children = new ModSection[] { new DifficultyReductionSection { Action = modButtonPressed }, new DifficultyIncreaseSection { Action = modButtonPressed }, new AutomationSection { Action = modButtonPressed }, new ConversionSection { Action = modButtonPressed }, new FunSection { Action = modButtonPressed }, } }, } }, ModSettingsContainer = new ModSettingsContainer { RelativeSizeAxes = Axes.Both, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Width = 0.3f, Alpha = 0, Padding = new MarginPadding(30), SelectedMods = { BindTarget = SelectedMods }, }, } }, }, new Drawable[] { new Container { Name = "Footer content", RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Color4(172, 20, 116, 255), Alpha = 0.5f, }, footerContainer = new FillFlowContainer { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, RelativePositionAxes = Axes.X, Width = content_width, Spacing = new Vector2(footer_button_spacing, footer_button_spacing / 2), Padding = new MarginPadding { Vertical = 15, Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Children = new Drawable[] { DeselectAllButton = new TriangleButton { Width = 180, Text = "Deselect All", Action = deselectAll, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, CustomiseButton = new TriangleButton { Width = 180, Text = "Customisation", Action = () => ModSettingsContainer.ToggleVisibility(), Enabled = { Value = false }, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, CloseButton = new TriangleButton { Width = 180, Text = "Close", Action = Hide, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Spacing = new Vector2(footer_button_spacing / 2, 0), Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Children = new Drawable[] { new OsuSpriteText { Text = @"Score Multiplier:", Font = OsuFont.GetFont(size: 30), Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, MultiplierLabel = new OsuSpriteText { Font = OsuFont.GetFont(size: 30, weight: FontWeight.Bold), Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Width = 70, // make width fixed so reflow doesn't occur when multiplier number changes. }, }, }, } } }, } }, }, }, }; ((IBindable <bool>)CustomiseButton.Enabled).BindTo(ModSettingsContainer.HasSettingsForSelection); }
private void load(OverlayColourProvider colourProvider) { Height = 150; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background5, }, new FillFlowContainer { Direction = FillDirection.Horizontal, Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }, Height = avatar_size, AutoSizeAxes = Axes.X, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Children = new Drawable[] { avatar = new UpdateableAvatar(isInteractive: false, showGuestOnNull: false) { Size = new Vector2(avatar_size), Masking = true, CornerRadius = avatar_size * 0.25f, }, new Container { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Padding = new MarginPadding { Left = 10 }, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { usernameText = new OsuSpriteText { Font = OsuFont.GetFont(size: 24, weight: FontWeight.Regular) }, openUserExternally = new ExternalLinkButton { Margin = new MarginPadding { Left = 5 }, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, } }, titleText = new OsuSpriteText { Font = OsuFont.GetFont(size: 18, weight: FontWeight.Regular) }, } }, new FillFlowContainer { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Both, Children = new Drawable[] { supporterTag = new SupporterIcon { Height = 20, Margin = new MarginPadding { Top = 5 } }, new Box { RelativeSizeAxes = Axes.X, Height = 1.5f, Margin = new MarginPadding { Top = 10 }, Colour = colourProvider.Light1, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Top = 5 }, Direction = FillDirection.Horizontal, Children = new Drawable[] { userFlag = new UpdateableFlag { Size = new Vector2(30, 20), ShowPlaceholderOnNull = false, }, userCountryText = new OsuSpriteText { Font = OsuFont.GetFont(size: 17.5f, weight: FontWeight.Regular), Margin = new MarginPadding { Left = 10 }, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Colour = colourProvider.Light1, } } }, } } } } } }, userStats = new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Y, Width = 300, Margin = new MarginPadding { Right = UserProfileOverlay.CONTENT_X_MARGIN }, Padding = new MarginPadding { Vertical = 15 }, Spacing = new Vector2(0, 2) } }; User.BindValueChanged(user => updateUser(user.NewValue)); }
private void load() { HostInfo hostInfo; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex(@"28242d"), }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING }, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 10), Padding = new MarginPadding { Vertical = 20 }, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { new OsuSpriteText { Font = OsuFont.GetFont(size: 30), Current = RoomName }, new RoomStatusInfo(), } }, hostInfo = new HostInfo(), }, }, new FillFlowContainer { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.X, Height = 70, Spacing = new Vector2(10, 0), Direction = FillDirection.Horizontal, Children = new Drawable[] { readyButton = new ReadyButton { Action = () => OnStart?.Invoke() } } } }, }, }; hostInfo.Host.BindTo(Host); Playlist.ItemsAdded += _ => updateBeatmap(); Playlist.ItemsRemoved += _ => updateBeatmap(); updateBeatmap(); }
private void load(OsuColour colours) { InternalChild = new AspectContainer { RelativeSizeAxes = Axes.Y, Anchor = Anchor.Centre, Origin = Anchor.Centre, Height = overscan, Children = new Drawable[] { circleOuterBackground = new CircularContainer { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Masking = true, Children = new Drawable[] { new Box { Alpha = 0.2f, RelativeSizeAxes = Axes.Both, Colour = Color4.Black, } } }, circleOuter = new CircularContainer { Size = new Vector2(circle_outer_scale), EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.4f), Type = EdgeEffectType.Shadow, Radius = 15, }, RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.White, }, backgroundParallax = new ParallaxContainer { RelativeSizeAxes = Axes.Both, ParallaxAmount = 0.01f, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { new Sprite { RelativeSizeAxes = Axes.Both, Alpha = 0.2f, Texture = Beatmap.Value.Background, Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill } } }, modeChangeButtons = new ResultModeTabControl { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.X, Height = 50, Margin = new MarginPadding { Bottom = 110 }, }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.BottomCentre, Text = $"{Score.MaxCombo}x", RelativePositionAxes = Axes.X, Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 40), X = 0.1f, Colour = colours.BlueDarker, }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.TopCentre, Text = "max combo", Font = OsuFont.GetFont(size: 20), RelativePositionAxes = Axes.X, X = 0.1f, Colour = colours.Gray6, }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.BottomCentre, Text = $"{Score.Accuracy:P2}", Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 40), RelativePositionAxes = Axes.X, X = 0.9f, Colour = colours.BlueDarker, }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.TopCentre, Text = "accuracy", Font = OsuFont.GetFont(size: 20), RelativePositionAxes = Axes.X, X = 0.9f, Colour = colours.Gray6, }, } }, circleInner = new CircularContainer { Size = new Vector2(0.6f), EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.4f), Type = EdgeEffectType.Shadow, Radius = 15, }, RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.White, }, } } } }; if (player != null) { AddInternal(new HotkeyRetryOverlay { Action = () => { if (!this.IsCurrentScreen()) { return; } player?.Restart(); }, }); } var pages = CreateResultPages(); foreach (var p in pages) { modeChangeButtons.AddItem(p); } modeChangeButtons.Current.Value = pages.FirstOrDefault(); modeChangeButtons.Current.BindValueChanged(page => { currentPage?.FadeOut(); currentPage?.Expire(); currentPage = page.NewValue?.CreatePage(); if (currentPage != null) { LoadComponentAsync(currentPage, circleInner.Add); } }, true); }
private void load(OverlayColourProvider colourProvider) { AddRangeInternal(new Drawable[] { new UpdateableBeatmapSetCover(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Y, Width = cover_width, BeatmapSet = beatmap.BeatmapSet, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = cover_width - corner_radius }, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = corner_radius, Children = new Drawable[] { new MostPlayedBeatmapContainer { Child = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(10), Children = new Drawable[] { new FillFlowContainer { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { new MostPlayedBeatmapMetadataContainer(beatmap), new LinkFlowContainer(t => { t.Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular); t.Colour = colourProvider.Foreground1; }) { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, }.With(d => { d.AddText("mapped by "); d.AddUserLink(beatmap.Metadata.Author); }), } }, new PlayCountText(playCount) { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight }, } }, } } } } } }); }
private void load(IAPIProvider api, OsuColour colour) { var user = score.User; statisticsLabels = GetStatistics(score).Select(s => new ScoreComponentLabel(s)).ToList(); DrawableAvatar innerAvatar; Children = new Drawable[] { new RankLabel(rank) { RelativeSizeAxes = Axes.Y, Width = rank_width, }, content = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = rank_width, }, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, CornerRadius = corner_radius, Masking = true, Children = new[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = user.Id == api.LocalUser.Value.Id && allowHighlight ? colour.Green : Color4.Black, Alpha = background_alpha, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(edge_margin), Children = new[] { avatar = new DelayedLoadWrapper( innerAvatar = new DrawableAvatar(user) { RelativeSizeAxes = Axes.Both, CornerRadius = corner_radius, Masking = true, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, }) { RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), }, new Container { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Position = new Vector2(HEIGHT - edge_margin, 0f), Children = new Drawable[] { nameLabel = new OsuSpriteText { Text = user.Username, Font = OsuFont.GetFont(size: 23, weight: FontWeight.Bold, italics: true) }, new FillFlowContainer { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10f, 0f), Children = new Drawable[] { flagBadgeContainer = new Container { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, Size = new Vector2(87f, 20f), Masking = true, Children = new Drawable[] { new UpdateableFlag(user.Country) { Width = 30, RelativeSizeAxes = Axes.Y, }, }, }, new FillFlowContainer { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10f, 0f), Margin = new MarginPadding { Left = edge_margin }, Children = statisticsLabels }, }, }, }, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Direction = FillDirection.Horizontal, Spacing = new Vector2(5f, 0f), Children = new Drawable[] { scoreLabel = new GlowingSpriteText { TextColour = Color4.White, GlowColour = Color4Extensions.FromHex(@"83ccfa"), Text = score.TotalScore.ToString(@"N0"), Font = OsuFont.Numeric.With(size: 23), }, RankContainer = new Container { Size = new Vector2(40f, 20f), Children = new[] { scoreRank = new UpdateableRank(score.Rank) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(40f) }, }, }, }, }, modsContainer = new FillFlowContainer <ModIcon> { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(1), ChildrenEnumerable = score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) }) }, }, }, }, }, }; innerAvatar.OnLoadComplete += d => d.FadeInFromZero(200); }
private void load(OverlayColourProvider colourProvider, GameHost host) { if (post.Slug != null) { TooltipText = "view in browser"; Action = () => host.OpenUrlExternally("https://osu.ppy.sh/home/news/" + post.Slug); } NewsBackground bg; AddRange(new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.X, Height = 160, Masking = true, CornerRadius = 6, Children = new Drawable[] { new DelayedLoadWrapper(bg = new NewsBackground(post.FirstImage) { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0 }) { RelativeSizeAxes = Axes.Both }, new DateContainer(post.PublishedAt) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Margin = new MarginPadding { Top = 10, Right = 15 } } } }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Horizontal = 15, Vertical = 10 }, Child = main = new TextFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y } } } } }); IdleColour = colourProvider.Background4; HoverColour = colourProvider.Background3; bg.OnLoadComplete += d => d.FadeIn(250, Easing.In); main.AddParagraph(post.Title, t => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold)); main.AddParagraph(post.Preview, t => t.Font = OsuFont.GetFont(size: 12)); // Should use sans-serif font main.AddParagraph("by ", t => t.Font = OsuFont.GetFont(size: 12)); main.AddText(post.Author, t => t.Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold)); }
private Drawable[] createContent(int index, ScoreInfo score) { var content = new List <Drawable> { new OsuSpriteText { Text = $"#{index + 1}", Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold) }, new UpdateableRank(score.Rank) { Size = new Vector2(30, 20) }, new OsuSpriteText { Margin = new MarginPadding { Right = horizontal_inset }, Text = $@"{score.TotalScore:N0}", Font = OsuFont.GetFont(size: text_size, weight: index == 0 ? FontWeight.Bold : FontWeight.Medium) }, new OsuSpriteText { Margin = new MarginPadding { Right = horizontal_inset }, Text = score.DisplayAccuracy, Font = OsuFont.GetFont(size: text_size), Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White }, }; var username = new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: text_size)) { AutoSizeAxes = Axes.Both }; username.AddUserLink(score.User); content.AddRange(new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Margin = new MarginPadding { Right = horizontal_inset }, Spacing = new Vector2(5, 0), Children = new Drawable[] { new UpdateableFlag(score.User.Country) { Size = new Vector2(20, 13), ShowPlaceholderOnNull = false, }, username } }, new OsuSpriteText { Text = $@"{score.MaxCombo:N0}x", Font = OsuFont.GetFont(size: text_size) } }); foreach (var kvp in score.SortedStatistics) { content.Add(new OsuSpriteText { Text = $"{kvp.Value}", Font = OsuFont.GetFont(size: text_size), Colour = kvp.Value == 0 ? Color4.Gray : Color4.White }); } content.AddRange(new Drawable[] { new OsuSpriteText { Text = $@"{score.PP:N0}", Font = OsuFont.GetFont(size: text_size) }, new FillFlowContainer { Direction = FillDirection.Horizontal, AutoSizeAxes = Axes.Both, Spacing = new Vector2(1), ChildrenEnumerable = score.Mods.Select(m => new ModIcon(m) { AutoSizeAxes = Axes.Both, Scale = new Vector2(0.3f) }) }, }); return(content.ToArray()); }
private void load() { InternalChild = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Masking = true, CornerExponent = 2.5f, CornerRadius = 20, EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.25f), Type = EdgeEffectType.Shadow, Radius = 1, Offset = new Vector2(0, 4) }, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4Extensions.FromHex("444") }, new UserCoverBackground { RelativeSizeAxes = Axes.Both, User = score.User, Colour = ColourInfo.GradientVertical(Color4.White.Opacity(0.5f), Color4Extensions.FromHex("#444").Opacity(0)) }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(10), Direction = FillDirection.Vertical, Spacing = new Vector2(0, 10), Children = new Drawable[] { new UpdateableAvatar(score.User) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Size = new Vector2(110), Masking = true, CornerExponent = 2.5f, CornerRadius = 20, EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.25f), Type = EdgeEffectType.Shadow, Radius = 8, Offset = new Vector2(0, 4), } }, new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = score.UserString, Font = OsuFont.GetFont(size: 16, weight: FontWeight.SemiBold) }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 5), ChildrenEnumerable = score.SortedStatistics.Select(s => createStatistic(s.Key.GetDescription(), s.Value.ToString())) }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Margin = new MarginPadding { Top = 10 }, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 5), Children = new[] { createStatistic("Max Combo", $"x{score.MaxCombo}"), createStatistic("Accuracy", $"{score.Accuracy.FormatAccuracy()}"), } }, new ModDisplay { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, AutoSizeAxes = Axes.Both, ExpansionMode = ExpansionMode.AlwaysExpanded, DisplayUnrankedText = false, Current = { Value = score.Mods }, Scale = new Vector2(0.5f), } } } } }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = 5 }, Child = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Current = scoreManager.GetBindableTotalScoreString(score), Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium, fixedWidth: true), Spacing = new Vector2(-1, 0) }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 2 }, Child = new DrawableRank(score.Rank) { Anchor = Anchor.Centre, Origin = Anchor.Centre, } } }, }, RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize), } } } }, }, RowDimensions = new[] { new Dimension(), new Dimension(GridSizeMode.Absolute, 45), } }; }
private void load(UserProfileOverlay profile) { if (colours == null) { throw new InvalidOperationException($"{nameof(colours)} not initialized!"); } FillFlowContainer infoContainer; AddInternal(content = new Container { RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 5, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.25f), Radius = 4, }, Children = new Drawable[] { new DelayedLoadUnloadWrapper(() => new UserCoverBackground { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, User = user, }, 300, 5000) { RelativeSizeAxes = Axes.Both, }, new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black.Opacity(0.7f), }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Top = content_padding, Horizontal = content_padding }, Children = new Drawable[] { new UpdateableAvatar { Size = new Vector2(height - status_height - content_padding * 2), User = user, Masking = true, CornerRadius = 5, OpenOnClick = { Value = false }, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.25f), Radius = 4, }, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = height - status_height - content_padding }, Children = new Drawable[] { new OsuSpriteText { Text = user.Username, Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 18, italics: true), }, infoContainer = new FillFlowContainer { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, AutoSizeAxes = Axes.X, Height = 20f, Direction = FillDirection.Horizontal, Spacing = new Vector2(5f, 0f), Children = new Drawable[] { new UpdateableFlag(user.Country) { Width = 30f, RelativeSizeAxes = Axes.Y, }, }, }, }, }, }, }, statusBar = new Container { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, Alpha = 0f, Children = new Drawable[] { statusBg = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f, }, new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Spacing = new Vector2(5f, 0f), Children = new Drawable[] { new SpriteIcon { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Icon = FontAwesome.Regular.Circle, Shadow = true, Size = new Vector2(14), }, statusMessage = new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = OsuFont.GetFont(weight: FontWeight.SemiBold), }, }, }, }, }, } }); if (user.IsSupporter) { infoContainer.Add(new SupporterIcon { Height = 20f, SupportLevel = user.SupportLevel }); } Status.ValueChanged += status => displayStatus(status.NewValue, Activity.Value); Activity.ValueChanged += activity => displayStatus(Status.Value, activity.NewValue); base.Action = ViewProfile = () => { Action?.Invoke(); profile?.ShowUser(user); }; }
private void load() { AddInternal(new ProfileItemContainer { Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = 20, Right = performance_width }, Children = new Drawable[] { new FillFlowContainer { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10, 0), Children = new Drawable[] { new UpdateableRank(Score.Rank) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Size = new Vector2(50, 20), }, new FillFlowContainer { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 2), Children = new Drawable[] { new ScoreBeatmapMetadataContainer(Score.Beatmap), new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(15, 0), Children = new Drawable[] { new OsuSpriteText { Text = $"{Score.Beatmap.Version}", Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular), Colour = colours.Yellow }, new DrawableDate(Score.Date, 12) { Colour = colourProvider.Foreground1 } } } } } } }, new FillFlowContainer { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Spacing = new Vector2(15), Children = new Drawable[] { new Container { AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Padding = new MarginPadding { Horizontal = 10, Vertical = 5 }, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Child = CreateRightContent() }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Direction = FillDirection.Horizontal, Spacing = new Vector2(2), Children = Score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.35f) }).ToList(), } } } } }, new Container { RelativeSizeAxes = Axes.Y, Width = performance_width, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Children = new Drawable[] { new Box { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Both, Height = 0.5f, Colour = colourProvider.Background4, Shear = new Vector2(-performance_background_shear, 0), EdgeSmoothness = new Vector2(2, 0), }, new Box { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Y, Height = -0.5f, Position = new Vector2(0, 1), Colour = colourProvider.Background4, Shear = new Vector2(performance_background_shear, 0), EdgeSmoothness = new Vector2(2, 0), }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = 5, Left = 30, Right = 20 }, Child = createDrawablePerformance().With(d => { d.Anchor = Anchor.Centre; d.Origin = Anchor.Centre; }) } } } } }); }