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