1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-09 09:20:05 +08:00
osu-lazer/osu.Game/Graphics/Containers/ShakeContainer.cs
2021-09-14 14:44:23 +09:00

26 lines
853 B
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Containers;
using osu.Game.Extensions;
namespace osu.Game.Graphics.Containers
{
/// <summary>
/// A container that adds the ability to shake its contents.
/// </summary>
public class ShakeContainer : Container
{
/// <summary>
/// The length of a single shake.
/// </summary>
public float ShakeDuration = 80;
/// <summary>
/// Shake the contents of this container.
/// </summary>
/// <param name="maximumLength">The maximum length the shake should last.</param>
public void Shake(double? maximumLength = null) => this.Shake(ShakeDuration, maximumLength: maximumLength);
}
}