mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Rename GameModes namespace to Screens.
This commit is contained in:
31
osu.Game/Screens/Menu/FlowContainerWithOrigin.cs
Normal file
31
osu.Game/Screens/Menu/FlowContainerWithOrigin.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
/// <summary>
|
||||
/// A flow container with an origin based on one of its contained drawables.
|
||||
/// </summary>
|
||||
public class FlowContainerWithOrigin : FlowContainer
|
||||
{
|
||||
/// <summary>
|
||||
/// A target drawable which this flowcontainer should be centered around.
|
||||
/// This target should be a direct child of this FlowContainer.
|
||||
/// </summary>
|
||||
public Drawable CentreTarget;
|
||||
|
||||
public override Anchor Origin => Anchor.Custom;
|
||||
|
||||
public override Vector2 OriginPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CentreTarget == null)
|
||||
return base.OriginPosition;
|
||||
|
||||
return CentreTarget.DrawPosition + CentreTarget.DrawSize / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user