mirror of
https://github.com/ppy/osu.git
synced 2024-11-09 09:20:05 +08:00
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using OpenTK;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Modes.Objects.Drawables;
|
|
|
|
namespace osu.Game.Modes.UI
|
|
{
|
|
public abstract class Playfield : Container
|
|
{
|
|
public HitObjectContainer HitObjects;
|
|
|
|
public virtual void Add(DrawableHitObject h) => HitObjects.Add(h);
|
|
|
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
|
|
|
protected override Container<Drawable> Content { get; }
|
|
|
|
protected Playfield()
|
|
{
|
|
AddInternal(Content = new ScaledContainer
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
});
|
|
|
|
Add(HitObjects = new HitObjectContainer
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
});
|
|
}
|
|
|
|
public virtual void PostProcess()
|
|
{
|
|
}
|
|
|
|
public class ScaledContainer : Container
|
|
{
|
|
protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512);
|
|
|
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
|
}
|
|
|
|
public class HitObjectContainer : Container<DrawableHitObject>
|
|
{
|
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
|
}
|
|
}
|
|
}
|