Make all Playfields completely relative.

This commit is contained in:
Dean Herbert
2017-04-10 19:21:27 +09:00
parent cd016c57c8
commit 960ea27684
5 changed files with 9 additions and 11 deletions

View File

@ -14,8 +14,7 @@ namespace osu.Game.Modes.Catch.UI
{ {
public CatchPlayfield() public CatchPlayfield()
{ {
RelativeSizeAxes = Axes.Y; Size = new Vector2(1, 0.9f);
Size = new Vector2(512, 0.9f);
Anchor = Anchor.BottomCentre; Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre; Origin = Anchor.BottomCentre;

View File

@ -15,8 +15,7 @@ namespace osu.Game.Modes.Mania.UI
{ {
public ManiaPlayfield(int columns) public ManiaPlayfield(int columns)
{ {
RelativeSizeAxes = Axes.Both; Size = new Vector2(0.8f, 1f);
Size = new Vector2(columns / 20f, 1f);
Anchor = Anchor.BottomCentre; Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre; Origin = Anchor.BottomCentre;

View File

@ -38,8 +38,6 @@ namespace osu.Game.Modes.Osu.UI
{ {
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Both;
Size = new Vector2(0.75f);
Add(new Drawable[] Add(new Drawable[]
{ {

View File

@ -52,11 +52,6 @@ namespace osu.Game.Modes.Taiko.UI
public TaikoPlayfield() public TaikoPlayfield()
{ {
RelativeSizeAxes = Axes.X;
// Default height
Height = DEFAULT_PLAYFIELD_HEIGHT;
AddInternal(new Drawable[] AddInternal(new Drawable[]
{ {
rightBackgroundContainer = new Container rightBackgroundContainer = new Container

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Modes.Objects; using osu.Game.Modes.Objects;
@ -63,6 +64,12 @@ namespace osu.Game.Modes.UI
Add(HitObjects); Add(HitObjects);
} }
public override Axes RelativeSizeAxes
{
get { return Axes.Both; }
set { throw new InvalidOperationException($@"{nameof(Playfield<TObject, TJudgement>)}'s {nameof(RelativeSizeAxes)} should never be changed from {Axes.Both}"); }
}
/// <summary> /// <summary>
/// Performs post-processing tasks (if any) after all DrawableHitObjects are loaded into this Playfield. /// Performs post-processing tasks (if any) after all DrawableHitObjects are loaded into this Playfield.
/// </summary> /// </summary>