mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 17:33:03 +08:00
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Modes.Objects.Drawables;
|
|
using OpenTK;
|
|
|
|
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;
|
|
|
|
public Playfield()
|
|
{
|
|
AddInternal(HitObjects = new HitObjectContainer
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
});
|
|
}
|
|
|
|
public class HitObjectContainer : Container<DrawableHitObject>
|
|
{
|
|
protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512);
|
|
|
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
|
}
|
|
}
|
|
}
|