public PanelBackground(WorkingBeatmap working) { CacheDrawnFrameBuffer = true; Children = new Drawable[] { new BeatmapBackgroundSprite(working) { Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, }, new FillFlowContainer { Depth = -1, Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Both, // This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle Shear = new Vector2(0.8f, 0), Alpha = 0.5f, Children = new[] { // The left half with no gradient applied new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Width = 0.4f, }, // Piecewise-linear gradient with 3 segments to make it appear smoother new Box { RelativeSizeAxes = Axes.Both, ColourInfo = ColourInfo.GradientHorizontal( Color4.Black, new Color4(0f, 0f, 0f, 0.9f)), Width = 0.05f, }, new Box { RelativeSizeAxes = Axes.Both, ColourInfo = ColourInfo.GradientHorizontal( new Color4(0f, 0f, 0f, 0.9f), new Color4(0f, 0f, 0f, 0.1f)), Width = 0.2f, }, new Box { RelativeSizeAxes = Axes.Both, ColourInfo = ColourInfo.GradientHorizontal( new Color4(0f, 0f, 0f, 0.1f), new Color4(0, 0, 0, 0)), Width = 0.05f, }, } }, }; }
private void load(AudioManager audio, OsuColour colours) { AutoSizeAxes = Axes.X; RelativeSizeAxes = Axes.Y; AddRange(new Drawable[] { new Box { RelativeSizeAxes = Axes.Y, Width = 300, Colour = ColourInfo.GradientHorizontal(Colour4.Black.Opacity(0.75f), Colour4.Black.Opacity(0)) }, muteButton = new MuteButton { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Margin = new MarginPadding(10), Current = { BindTarget = IsMuted } }, volumeMeters = new SelectionCycleFillFlowContainer <VolumeMeter> { Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Spacing = new Vector2(0, offset), Margin = new MarginPadding { Left = offset }, Children = new[] { volumeMeterEffect = new VolumeMeter("EFFECTS", 125, colours.BlueDarker), volumeMeterMaster = new VolumeMeter("MASTER", 150, colours.PinkDarker), volumeMeterMusic = new VolumeMeter("MUSIC", 125, colours.BlueDarker), } } }); volumeMeterMaster.Bindable.BindTo(audio.Volume); volumeMeterEffect.Bindable.BindTo(audio.VolumeSample); volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack); IsMuted.BindValueChanged(muted => { if (muted.NewValue) { audio.AddAdjustment(AdjustableProperty.Volume, muteAdjustment); } else { audio.RemoveAdjustment(AdjustableProperty.Volume, muteAdjustment); } }); }
private void load(OsuGameBase game, OsuColour colours) { beatmap.BindTo(game.Beatmap); // linear colour looks better in this case, so let's use it for now. Color4 gradientDark = colours.Blue.Opacity(0).ToLinear(); Color4 gradientLight = colours.Blue.Opacity(0.3f).ToLinear(); leftBox.Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark); rightBox.Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight); }
internal void UpdateState() { if (bindable == null) { return; } var colour = bindable.Disabled ? Color4.Gray : buttonColour; this.FadeTo(bindable.IsDefault ? 0f : hovering && !bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint); this.FadeColour(ColourInfo.GradientHorizontal(colour.Opacity(0.8f), colour.Opacity(0)), 200, Easing.OutQuint); }
public PanelBackground() { InternalChildren = new Drawable[] { new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, Beatmap = { BindTarget = Beatmap } }, new FillFlowContainer { Depth = -1, RelativeSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, // This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle Shear = new Vector2(0.8f, 0), Alpha = 0.5f, Children = new[] { // The left half with no gradient applied new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Width = 0.4f, }, // Piecewise-linear gradient with 3 segments to make it appear smoother new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Color4.Black, new Color4(0f, 0f, 0f, 0.9f)), Width = 0.05f, }, new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(new Color4(0f, 0f, 0f, 0.9f), new Color4(0f, 0f, 0f, 0.1f)), Width = 0.2f, }, new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(new Color4(0f, 0f, 0f, 0.1f), new Color4(0, 0, 0, 0)), Width = 0.05f, }, } } }; }
public PanelBackground() { UpdateableBeatmapBackgroundSprite backgroundSprite; InternalChildren = new Drawable[] { backgroundSprite = new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, }, new FillFlowContainer { Depth = -1, RelativeSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, // This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle Shear = new Vector2(0.8f, 0), Alpha = 0.5f, Children = new[] { // The left half with no gradient applied new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Width = 0.4f, }, // Piecewise-linear gradient with 2 segments to make it appear smoother new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Color4.Black, new Color4(0f, 0f, 0f, 0.7f)), Width = 0.4f, }, new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(new Color4(0f, 0f, 0f, 0.7f), new Color4(0, 0, 0, 0.4f)), Width = 0.4f, }, } } }; // manual binding required as playlists don't expose IBeatmapInfo currently. // may be removed in the future if this changes. Beatmap.BindValueChanged(beatmap => backgroundSprite.Beatmap.Value = beatmap.NewValue); }
private ColourInfo getGradient(bool flipped = false) { if (game.IsInsidersBuild) { return(flipped ? ColourInfo.GradientHorizontal(grad_ins_b, grad_ins_a) : ColourInfo.GradientHorizontal(grad_ins_a, grad_ins_b)); } else { return(flipped ? ColourInfo.GradientHorizontal(grad_pub_b, grad_pub_a) : ColourInfo.GradientHorizontal(grad_pub_a, grad_pub_b)); } }
public static ColourInfo Deserialize(string data) { data = data.Trim(); string[] parts; if (data.StartsWith("gradient(", StringComparison.OrdinalIgnoreCase) && data.EndsWith(')')) { parts = data.Substring(9, data.Length - 10).SplitByComma(); var direction = parts[0]; if (direction.Equals("vertical", StringComparison.OrdinalIgnoreCase)) { return(ColourInfo.GradientVertical( c1: Color4Converter.Deserialize(parts[1]), c2: Color4Converter.Deserialize(parts[2]))); } if (direction.Equals("horizontal", StringComparison.OrdinalIgnoreCase)) { return(ColourInfo.GradientHorizontal( c1: Color4Converter.Deserialize(parts[1]), c2: Color4Converter.Deserialize(parts[2]))); } } parts = data.SplitByComma(); if (parts.Length == 1) { return(ColourInfo.SingleColour(Color4Converter.Deserialize(parts[0]))); } if (parts.Length == 4) { return new ColourInfo { TopLeft = Color4Converter.Deserialize(parts[0]), TopRight = Color4Converter.Deserialize(parts[1]), BottomRight = Color4Converter.Deserialize(parts[2]), BottomLeft = Color4Converter.Deserialize(parts[3]) } } ; throw new FormatException($"Unrecognized {nameof(ColourInfo)} '{data}'."); } }
private void updateColour() { Color4 baseColour = colours.Blue; if (user.Value?.IsSupporter ?? false) { baseColour = skin.Value.GetValue <SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("MenuGlow") ? s.CustomColours["MenuGlow"] : (Color4?)null) ?? baseColour; } // linear colour looks better in this case, so let's use it for now. Color4 gradientDark = baseColour.Opacity(0).ToLinear(); Color4 gradientLight = baseColour.Opacity(0.6f).ToLinear(); leftBox.Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark); rightBox.Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight); }
public BackgroundStrip(float start, float end) { RelativeSizeAxes = Axes.Both; Width = 0f; Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(start), Color4.White.Opacity(end)); Masking = true; Children = new[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.White, } }; }
private void updateColour() { Color4 baseColour = colours.Blue; if (user.Value?.IsSupporter ?? false) { baseColour = skin.Value.GetConfig <GlobalSkinColours, Color4>(GlobalSkinColours.MenuGlow)?.Value ?? baseColour; } // linear colour looks better in this case, so let's use it for now. Color4 gradientDark = baseColour.Opacity(0).ToLinear(); Color4 gradientLight = baseColour.Opacity(0.6f).ToLinear(); leftBox.Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark); rightBox.Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight); }
public CameraDevicesDropdownHeader() { BackgroundColour = Colour4.Transparent; BackgroundColourHover = Colour4.Transparent; Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.X, Height = 25, Child = label = new HoloTrackSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, }, chevron = new Sprite { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, }, new Box { Width = 0.5f, Height = 1, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Colour = ColourInfo.GradientHorizontal(Colour4.Transparent, Colour4.White), RelativeSizeAxes = Axes.X, }, new Box { Width = 0.5f, Height = 1, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Colour = ColourInfo.GradientHorizontal(Colour4.White, Colour4.Transparent), RelativeSizeAxes = Axes.X, }, }; }
private void load(OsuColour colours) { Content.CornerRadius = 5; AddRange(new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.25f), Color4.Black.Opacity(0.75f)), }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = vertical_padding, Bottom = vertical_padding, Left = horizontal_padding, Right = vertical_padding }, Children = new Drawable[] { new FillFlowContainer { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, LayoutEasing = Easing.OutQuint, LayoutDuration = transition_duration, Spacing = new Vector2(10, 0), 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[]
protected SaturationValueSelector() { RelativeSizeAxes = Axes.X; InternalChildren = new[] { SelectionArea = new Container { RelativeSizeAxes = Axes.Both, Children = new[] { hueBox = new Box { Name = "Hue", RelativeSizeAxes = Axes.Both, Colour = new Colour4(255, 0, 0, 255) }, new Box { Name = "Saturation", RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Colour4.White, Colour4.White.Opacity(0)) }, new Box { Name = "Value", RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(Colour4.Black.Opacity(0), Colour4.Black) }, } }, marker = CreateMarker().With(d => { d.Current.BindTo(Current); d.Origin = Anchor.Centre; d.RelativePositionAxes = Axes.Both; }) }; }
public void SetUpSteps() { AddStep("Add new scroll container", () => { Children = new Drawable[] { new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, Height = 250, Width = 0.75f, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(30) }, scrollContainer = new ZoomableScrollContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, } } }, new MenuCursor() }; scrollContainer.Add(innerBox = new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(new Color4(0.8f, 0.6f, 0.4f, 1f), new Color4(0.4f, 0.6f, 0.8f, 1f)) }); }); AddUntilStep("Scroll container is loaded", () => scrollContainer.LoadState >= LoadState.Loaded); }
private void load() { RelativeSizeAxes = Axes.Both; Alpha = 0.1f; AddRangeInternal(new[] { // fade out over intro time, outside the valid time bounds. new Box { RelativeSizeAxes = Axes.Y, Width = 200, Origin = Anchor.TopRight, Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White), }, new Box { Colour = Color4.White, RelativeSizeAxes = Axes.Both, } }); }
public GradientLine() { RelativeSizeAxes = Axes.X; Size = new Vector2(0.8f, 1f); Content = new[] { new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Color4.Transparent, Colour) }, new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Colour, Color4.Transparent) }, } }; }
protected virtual Drawable AddCharacterToFlow(char c) { // Remove all characters to the right and store them in a local list, // such that their depth can be updated. List <Drawable> charsRight = new List <Drawable>(); foreach (Drawable d in TextFlow.Children.Skip(selectionLeft)) { charsRight.Add(d); } TextFlow.RemoveRange(charsRight); // Update their depth to make room for the to-be inserted character. int i = -selectionLeft; foreach (Drawable d in charsRight) { d.Depth = --i; } // Add the character Drawable ch = GetDrawableCharacter(c); ch.Depth = -selectionLeft; TextFlow.Add(ch); var transparentWhite = new Color4(1, 1, 1, 0f); ch.FadeColour(transparentWhite) .FadeColour(ColourInfo.GradientHorizontal(Color4.White, transparentWhite), caret_move_time / 2).Then() .FadeColour(Color4.White, caret_move_time / 2); // Add back all the previously removed characters TextFlow.AddRange(charsRight); return(ch); }
private void load(IBindableBeatmap beatmap, OsuColour colours) { this.beatmap.BindTo(beatmap); // linear colour looks better in this case, so let's use it for now. Color4 gradientDark = colours.Blue.Opacity(0).ToLinear(); Color4 gradientLight = colours.Blue.Opacity(0.6f).ToLinear(); Children = new Drawable[] { leftBox = new Box { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.Y, Width = box_width * 2, Height = 1.5f, // align off-screen to make sure our edges don't become visible during parallax. X = -box_width, Alpha = 0, Blending = BlendingMode.Additive, Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark) }, rightBox = new Box { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Y, Width = box_width * 2, Height = 1.5f, X = box_width, Alpha = 0, Blending = BlendingMode.Additive, Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight) } }; }
private void updateComboColour() { if (!(HitObject is IHasComboInformation combo)) { return; } var comboColours = skin.GetConfig <GlobalSkinColours, IReadOnlyList <Color4> >(GlobalSkinColours.ComboColours)?.Value ?? Array.Empty <Color4>(); var comboColour = combo.GetComboColour(comboColours); if (IsSelected) { border.Show(); comboColour = comboColour.Lighten(0.3f); } else { border.Hide(); } if (HitObject is IHasDuration duration && duration.Duration > 0) { circle.Colour = ColourInfo.GradientHorizontal(comboColour, comboColour.Lighten(0.4f)); }
private void updateGlow() { leftGlow.ColourInfo = ColourInfo.GradientHorizontal(new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f), ButtonColour); centerGlow.Colour = ButtonColour; rightGlow.ColourInfo = ColourInfo.GradientHorizontal(ButtonColour, new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f)); }
private void load(OverlayColourProvider colours) { ButtonsContainer = new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X }; InternalChildren = new[] { // This resolves internal 1px gaps due to applying the (parenting) corner radius and masking across multiple filling background sprites. new Box { RelativeSizeAxes = Axes.Both, Colour = colours.Background5, }, CreateBackground().With(d => { d.RelativeSizeAxes = Axes.Both; }), wrapper = new DelayedLoadWrapper(() => new Container { Name = @"Room content", RelativeSizeAxes = Axes.Both, // This negative padding resolves 1px gaps between this background and the background above. Padding = new MarginPadding { Left = 20, Vertical = -0.5f }, Child = new Container { RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = CORNER_RADIUS, Children = new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.Relative, 0.2f) }, Content = new[] { new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = colours.Background5, }, new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(colours.Background5, colours.Background5.Opacity(0.3f)) }, } } }, new Container { Name = @"Left details", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = 20, Vertical = 5 }, Children = new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5), Children = new Drawable[] { new RoomStatusPill { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft }, specialCategoryPill = new RoomSpecialCategoryPill { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft }, endDateInfo = new EndDateInfo { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, } }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Top = 3 }, Direction = FillDirection.Vertical, Children = new Drawable[] { new RoomNameText(), new RoomStatusText() } } }, }, new FillFlowContainer { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5), ChildrenEnumerable = CreateBottomDetails() } } }, new FillFlowContainer { Name = "Right content", Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Spacing = new Vector2(5), Padding = new MarginPadding { Right = 10, Vertical = 20, }, Children = new Drawable[] { ButtonsContainer, drawableRoomParticipantsList = new DrawableRoomParticipantsList { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, NumberOfCircles = NumberOfAvatars } } }, passwordIcon = new PasswordProtectedIcon { Alpha = 0 } }, }, }, 0) { RelativeSizeAxes = Axes.Both, } }; }
private void load(OsuColour colours) { const float user_header_height = 120; Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = user_header_height }, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.White, }, } }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new UserHeader(Score.User) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, Height = user_header_height, }, new DrawableRank(Score.Rank) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Size = new Vector2(150, 60), Margin = new MarginPadding(20), }, new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, Height = 60, Children = new Drawable[] { new SongProgressGraph { RelativeSizeAxes = Axes.Both, Alpha = 0.5f, Objects = Beatmap.Beatmap.HitObjects, }, scoreCounter = new SlowScoreCounter(6) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = colours.PinkDarker, Y = 10, TextSize = 56, }, } }, new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = colours.PinkDarker, Shadow = false, Font = @"Exo2.0-Bold", TextSize = 16, Text = "total score", Margin = new MarginPadding { Bottom = 15 }, }, new BeatmapDetails(Beatmap.BeatmapInfo) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Margin = new MarginPadding { Bottom = 10 }, }, new DateTimeDisplay(Score.Date.LocalDateTime) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, new Container { RelativeSizeAxes = Axes.X, Size = new Vector2(0.75f, 1), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Margin = new MarginPadding { Top = 10, Bottom = 10 }, Children = new Drawable[] { new Box { Colour = ColourInfo.GradientHorizontal( colours.GrayC.Opacity(0), colours.GrayC.Opacity(0.9f)), RelativeSizeAxes = Axes.Both, Size = new Vector2(0.5f, 1), }, new Box { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Colour = ColourInfo.GradientHorizontal( colours.GrayC.Opacity(0.9f), colours.GrayC.Opacity(0)), RelativeSizeAxes = Axes.Both, Size = new Vector2(0.5f, 1), }, } }, statisticsContainer = new FillFlowContainer <DrawableScoreStatistic> { AutoSizeAxes = Axes.Both, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Direction = FillDirection.Horizontal, LayoutDuration = 200, LayoutEasing = Easing.OutQuint } } } }; statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s)); }
private void load(OsuColour colours) { Content.CornerRadius = 5; AddRange(new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.25f), Color4.Black.Opacity(0.75f)), }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = vertical_padding, Bottom = vertical_padding, Left = horizontal_padding, Right = vertical_padding }, Children = new Drawable[] { new FillFlowContainer { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, LayoutEasing = Easing.OutQuint, LayoutDuration = transition_duration, Spacing = new Vector2(10, 0), 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[] { playButton = new PlayButton(SetInfo) { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Size = new Vector2(height / 3), FillMode = FillMode.Fit, Margin = new MarginPadding { Right = 10 }, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { titleContainer = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new[] { new OsuSpriteText { Text = new RomanisableString(SetInfo.Metadata.TitleUnicode, SetInfo.Metadata.Title), Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true) }, } }, new OsuSpriteText { Text = new RomanisableString(SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist), Font = OsuFont.GetFont(weight: FontWeight.Bold, italics: true) }, } }, } }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { statusContainer = new FillFlowContainer { AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Vertical = vertical_padding, Horizontal = 5 }, Spacing = new Vector2(5), }, new FillFlowContainer { AutoSizeAxes = Axes.X, Height = 20, Margin = new MarginPadding { Top = vertical_padding, Bottom = vertical_padding }, Spacing = new Vector2(3), Children = GetDifficultyIcons(colours), }, }, }, }, }, } }, new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.Both, Child = DownloadButton = new BeatmapPanelDownloadButton(SetInfo) { Size = new Vector2(height - vertical_padding * 3), Margin = new MarginPadding { Left = vertical_padding * 2, Right = vertical_padding }, }, }, new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { new Statistic(FontAwesome.Solid.PlayCircle, SetInfo.OnlineInfo?.PlayCount ?? 0), new Statistic(FontAwesome.Solid.Heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0), new LinkFlowContainer(s => { s.Shadow = false; s.Font = OsuFont.GetFont(size: 14); }) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Both, }.With(d => { d.AutoSizeAxes = Axes.Both; d.AddText("mapped by "); d.AddUserLink(SetInfo.Metadata.Author); }), new OsuSpriteText { Text = SetInfo.Metadata.Source, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Font = OsuFont.GetFont(size: 14), Alpha = string.IsNullOrEmpty(SetInfo.Metadata.Source) ? 0f : 1f, }, }, }, }, }, }, }, progressBar = new Box { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, BypassAutoSizeAxes = Axes.Y, Size = new Vector2(0, 3), Alpha = 0, Colour = colours.Yellow, }, }); if (SetInfo.OnlineInfo?.HasExplicitContent ?? false) { titleContainer.Add(new ExplicitContentBeatmapPill { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Margin = new MarginPadding { Left = 10f, Top = 2f }, }); } if (SetInfo.OnlineInfo?.HasVideo ?? false) { statusContainer.Add(new IconPill(FontAwesome.Solid.Film) { IconSize = new Vector2(20) }); } if (SetInfo.OnlineInfo?.HasStoryboard ?? false) { statusContainer.Add(new IconPill(FontAwesome.Solid.Image) { IconSize = new Vector2(20) }); } statusContainer.Add(new BeatmapSetOnlineStatusPill { TextSize = 12, TextPadding = new MarginPadding { Horizontal = 10, Vertical = 4 }, Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None, }); }
private void load() { Background.Width = 0.5f; Background.Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(1), Color4.White.Opacity(0.3f)); }
public TestCaseEffects() { var effect = new EdgeEffect { CornerRadius = 3f, Parameters = new EdgeEffectParameters { Colour = Color4.LightBlue, Hollow = true, Radius = 5f, Type = EdgeEffectType.Glow } }; Add(new FillFlowContainer { Position = new Vector2(10f, 10f), Spacing = new Vector2(25f, 25f), RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new SpriteText { Text = "Blur Test", Font = new FontUsage(size: 32), }.WithEffect(new BlurEffect { Sigma = new Vector2(2f, 0f), Strength = 2f, Rotation = 45f, }), new SpriteText { Text = "EdgeEffect Test", Font = new FontUsage(size: 32), }.WithEffect(new EdgeEffect { CornerRadius = 3f, Parameters = new EdgeEffectParameters { Colour = Color4.Yellow, Hollow = true, Radius = 5f, Type = EdgeEffectType.Shadow } }), new SpriteText { Text = "Repeated usage of same effect test", Font = new FontUsage(size: 32), }.WithEffect(effect), new SpriteText { Text = "Repeated usage of same effect test", Font = new FontUsage(size: 32), }.WithEffect(effect), new SpriteText { Text = "Repeated usage of same effect test", Font = new FontUsage(size: 32), }.WithEffect(effect), new SpriteText { Text = "Multiple effects Test", Font = new FontUsage(size: 32), }.WithEffect(new BlurEffect { Sigma = new Vector2(2f, 2f), Strength = 2f }).WithEffect(new EdgeEffect { CornerRadius = 3f, Parameters = new EdgeEffectParameters { Colour = Color4.Yellow, Hollow = true, Radius = 5f, Type = EdgeEffectType.Shadow } }), new Container { AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Box { Colour = Color4.CornflowerBlue, RelativeSizeAxes = Axes.Both, }, new SpriteText { Text = "Outlined Text", Font = new FontUsage(size: 32), }.WithEffect(new OutlineEffect { BlurSigma = new Vector2(3f), Strength = 3f, Colour = Color4.Red, PadExtent = true, }) } }, new Container { AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Box { Colour = Color4.CornflowerBlue, RelativeSizeAxes = Axes.Both, }, new SpriteText { Text = "Glowing Text", Font = new FontUsage(size: 32), }.WithEffect(new GlowEffect { BlurSigma = new Vector2(3f), Strength = 3f, Colour = ColourInfo.GradientHorizontal(new Color4(1.2f, 0, 0, 1f), new Color4(0, 1f, 0, 1f)), PadExtent = true, }), } }, new Container { AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = Color4.White, Size = new Vector2(150, 40), }.WithEffect(new GlowEffect { BlurSigma = new Vector2(3f), Strength = 3f, Colour = ColourInfo.GradientHorizontal(new Color4(1.2f, 0, 0, 1f), new Color4(0, 1f, 0, 1f)), PadExtent = true, }), changeColourText = new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "Absolute Size", Font = new FontUsage(size: 32), Colour = Color4.Red, Shadow = true, } } }, new Container { AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = Color4.White, RelativeSizeAxes = Axes.Both, Size = new Vector2(1.1f, 1.1f), }.WithEffect(new GlowEffect { BlurSigma = new Vector2(3f), Strength = 3f, Colour = ColourInfo.GradientHorizontal(new Color4(1.2f, 0, 0, 1f), new Color4(0, 1f, 0, 1f)), PadExtent = true, }), new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "Relative Size", Font = new FontUsage(size: 32), Colour = Color4.Red, Shadow = true, }, } }, new Container { AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = Color4.White, RelativeSizeAxes = Axes.Both, Size = new Vector2(1.1f, 1.1f), Rotation = 10, }.WithEffect(new GlowEffect { BlurSigma = new Vector2(3f), Strength = 3f, Colour = ColourInfo.GradientHorizontal(new Color4(1.2f, 0, 0, 1f), new Color4(0, 1f, 0, 1f)), PadExtent = true, }), new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "Rotation", Font = new FontUsage(size: 32), Colour = Color4.Red, Shadow = true, }, } }, } }); }
private void load(LocalisationEngine localisation) { Content.CornerRadius = 5; AddRange(new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.25f), Color4.Black.Opacity(0.75f)), }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = vertical_padding, Bottom = vertical_padding, Left = horizontal_padding, Right = vertical_padding }, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { new OsuSpriteText { Current = localisation.GetUnicodePreference(SetInfo.Metadata.TitleUnicode, SetInfo.Metadata.Title), TextSize = 18, Font = @"Exo2.0-BoldItalic", }, new OsuSpriteText { Current = localisation.GetUnicodePreference(SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist), Font = @"Exo2.0-BoldItalic", }, new FillFlowContainer { AutoSizeAxes = Axes.X, Height = 20, Margin = new MarginPadding { Top = vertical_padding, Bottom = vertical_padding }, Children = GetDifficultyIcons(), }, }, }, new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Margin = new MarginPadding { Right = height - vertical_padding * 2 + vertical_padding }, Children = new Drawable[] { new Statistic(FontAwesome.fa_play_circle, SetInfo.OnlineInfo?.PlayCount ?? 0) { Margin = new MarginPadding { Right = 1 }, }, new Statistic(FontAwesome.fa_heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0), new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new[] { new OsuSpriteText { Text = "mapped by ", TextSize = 14, }, new OsuSpriteText { Text = SetInfo.Metadata.Author, TextSize = 14, Font = @"Exo2.0-SemiBoldItalic", }, }, }, new OsuSpriteText { Text = $"from {SetInfo.Metadata.Source}", Anchor = Anchor.TopRight, Origin = Anchor.TopRight, TextSize = 14, Alpha = string.IsNullOrEmpty(SetInfo.Metadata.Source) ? 0f : 1f, }, }, }, new DownloadButton { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Size = new Vector2(height - vertical_padding * 2), Action = StartDownload }, }, }, }); }
public GradientPart(Color4 start, Color4 end) { RelativeSizeAxes = Axes.Both; Colour = ColourInfo.GradientHorizontal(start, end); }
private void load() { var user = User.User; var backgroundColour = Color4Extensions.FromHex("#33413C"); InternalChild = new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.Absolute, 18), new Dimension(GridSizeMode.AutoSize), new Dimension(), new Dimension(GridSizeMode.AutoSize), }, Content = new[] { new Drawable[] { crown = new SpriteIcon { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Icon = FontAwesome.Solid.Crown, Size = new Vector2(14), Colour = Color4Extensions.FromHex("#F7E65D"), Alpha = 0 }, new TeamDisplay(User), new Container { RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 5, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour }, new UserCoverBackground { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Both, Width = 0.75f, User = user, Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White.Opacity(0.25f)) }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Spacing = new Vector2(10), Direction = FillDirection.Horizontal, Children = new Drawable[] { new UpdateableAvatar { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, User = user }, new UpdateableFlag { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Size = new Vector2(30, 20), Country = user?.Country }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 18), Text = user?.Username }, userRankText = new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = OsuFont.GetFont(size: 14), } } }, new Container { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Right = 70 }, Child = userModsDisplay = new ModDisplay { Scale = new Vector2(0.5f), ExpansionMode = ExpansionMode.AlwaysContracted, } }, userStateDisplay = new StateDisplay { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding { Right = 10 }, } } }, kickButton = new KickButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0, Margin = new MarginPadding(4), Action = () => Client.KickUser(User.UserID), }, }, } }; }
private void load() { Debug.Assert(User.User != null); var backgroundColour = Color4Extensions.FromHex("#33413C"); InternalChildren = new Drawable[] { crown = new SpriteIcon { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Icon = FontAwesome.Solid.Crown, Size = new Vector2(14), Colour = Color4Extensions.FromHex("#F7E65D"), Alpha = 0 }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = 24 }, Child = new Container { RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 5, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour }, new UserCoverBackground { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Both, Width = 0.75f, User = User.User, Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White.Opacity(0.25f)) }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Spacing = new Vector2(10), Direction = FillDirection.Horizontal, Children = new Drawable[] { new UpdateableAvatar { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, User = User.User }, new UpdateableFlag { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Size = new Vector2(30, 20), Country = User.User.Country }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 18), Text = User.User.Username }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = OsuFont.GetFont(size: 14), Text = User.User.CurrentModeRank != null ? $"#{User.User.CurrentModeRank}" : string.Empty } } }, userStateDisplay = new StateDisplay { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding { Right = 10 }, } } } } }; }