1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 03:52:55 +08:00
osu-lazer/osu.Game/Graphics/Containers/ShakeContainer.cs

28 lines
880 B
C#
Raw Normal View History

// 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.
2022-06-17 15:37:17 +08:00
#nullable disable
using osu.Framework.Graphics.Containers;
2021-09-14 13:44:23 +08:00
using osu.Game.Extensions;
namespace osu.Game.Graphics.Containers
{
2018-07-06 11:13:23 +08:00
/// <summary>
/// A container that adds the ability to shake its contents.
/// </summary>
2022-11-24 13:32:20 +08:00
public partial class ShakeContainer : Container
{
/// <summary>
/// The length of a single shake.
/// </summary>
public float ShakeDuration = 80;
2018-07-06 11:13:23 +08:00
/// <summary>
/// Shake the contents of this container.
/// </summary>
/// <param name="maximumLength">The maximum length the shake should last.</param>
2021-09-14 13:44:23 +08:00
public void Shake(double? maximumLength = null) => this.Shake(ShakeDuration, maximumLength: maximumLength);
}
}