2019-01-24 16:43:03 +08: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-09-21 14:08:43 +08:00
|
|
|
|
2019-11-20 20:19:49 +08:00
|
|
|
using System;
|
2019-03-26 12:31:49 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Rulesets.UI;
|
2018-11-20 15:51:59 +08:00
|
|
|
using osuTK;
|
2018-09-21 14:08:43 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.UI
|
|
|
|
{
|
2019-03-26 12:31:49 +08:00
|
|
|
public class TaikoPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
2018-09-21 14:08:43 +08:00
|
|
|
{
|
|
|
|
private const float default_relative_height = TaikoPlayfield.DEFAULT_HEIGHT / 768;
|
|
|
|
private const float default_aspect = 16f / 9f;
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
2019-11-20 20:19:49 +08:00
|
|
|
float aspectAdjust = Math.Clamp(Parent.ChildSize.X / Parent.ChildSize.Y, 0.4f, 4) / default_aspect;
|
2018-09-21 14:08:43 +08:00
|
|
|
Size = new Vector2(1, default_relative_height * aspectAdjust);
|
2020-05-12 14:51:59 +08:00
|
|
|
|
|
|
|
// Position the taiko playfield exactly one playfield from the top of the screen.
|
|
|
|
RelativePositionAxes = Axes.Y;
|
|
|
|
Y = Size.Y;
|
2018-09-21 14:08:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|