mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 18:27:26 +08:00
Add constant for osu! playfield size.
This commit is contained in:
parent
ef5d50e7d8
commit
2df21066e7
@ -45,7 +45,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
objects.Add(new HitCircle
|
||||
{
|
||||
StartTime = time,
|
||||
Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)),
|
||||
Position = new Vector2(RNG.Next(0, (int)OsuPlayfield.BASE_SIZE.X), RNG.Next(0, (int)OsuPlayfield.BASE_SIZE.Y)),
|
||||
Scale = RNG.NextSingle(0.5f, 1.0f),
|
||||
});
|
||||
|
||||
|
@ -14,6 +14,7 @@ using osu.Game.Modes.Osu.Objects;
|
||||
using osu.Game.Screens.Play;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Desktop.VisualTests.Beatmaps;
|
||||
using osu.Game.Modes.Osu.UI;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -52,8 +53,8 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
objects.Add(new HitCircle
|
||||
{
|
||||
StartTime = time,
|
||||
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : 512,
|
||||
i % 4 < 2 ? 0 : 384),
|
||||
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : OsuPlayfield.BASE_SIZE.X,
|
||||
i % 4 < 2 ? 0 : OsuPlayfield.BASE_SIZE.Y),
|
||||
NewCombo = i % 4 == 0
|
||||
});
|
||||
|
||||
|
@ -10,6 +10,7 @@ using System.Collections.Generic;
|
||||
using osu.Game.Modes.Objects.Types;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using osu.Game.Modes.Osu.UI;
|
||||
using osu.Game.Modes.Beatmaps;
|
||||
|
||||
namespace osu.Game.Modes.Osu.Beatmaps
|
||||
@ -66,7 +67,7 @@ namespace osu.Game.Modes.Osu.Beatmaps
|
||||
Samples = original.Samples,
|
||||
EndTime = endTimeData.EndTime,
|
||||
|
||||
Position = positionData?.Position ?? new Vector2(512, 384) / 2,
|
||||
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Osu.Objects.Drawables.Pieces;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Modes.Osu.UI;
|
||||
|
||||
namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
{
|
||||
@ -29,7 +30,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
Position = s.Position;
|
||||
|
||||
//take up full playfield.
|
||||
Size = new Vector2(512);
|
||||
Size = OsuPlayfield.BASE_SIZE;
|
||||
|
||||
spinner = s;
|
||||
|
||||
|
@ -23,6 +23,8 @@ namespace osu.Game.Modes.Osu.UI
|
||||
|
||||
public override bool ProvidingUserCursor => true;
|
||||
|
||||
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
|
||||
|
||||
public override Vector2 Size
|
||||
{
|
||||
get
|
||||
@ -34,7 +36,7 @@ namespace osu.Game.Modes.Osu.UI
|
||||
}
|
||||
}
|
||||
|
||||
public OsuPlayfield() : base(512)
|
||||
public OsuPlayfield() : base(BASE_SIZE.X)
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
@ -94,4 +96,4 @@ namespace osu.Game.Modes.Osu.UI
|
||||
judgementLayer.Add(explosion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user