mirror of
https://github.com/ppy/osu
synced 2024-12-14 02:46:27 +00:00
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using System.Collections.Generic;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Graphics.Backgrounds;
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
{
|
|
/// <summary>
|
|
/// A button with moving triangles in the background.
|
|
/// </summary>
|
|
public class TriangleButton : OsuButton, IFilterable
|
|
{
|
|
protected Triangles Triangles { get; private set; }
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OsuColour colours)
|
|
{
|
|
Add(Triangles = new Triangles
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
ColourDark = colours.BlueDarker,
|
|
ColourLight = colours.Blue,
|
|
});
|
|
}
|
|
|
|
public IEnumerable<string> FilterTerms => new[] { Text };
|
|
|
|
public bool MatchingFilter
|
|
{
|
|
set
|
|
{
|
|
this.FadeTo(value ? 1 : 0);
|
|
}
|
|
}
|
|
}
|
|
}
|