2023-07-24 17:22:32 +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.
|
|
|
|
|
2023-07-25 04:07:11 +08:00
|
|
|
using System;
|
2023-07-25 03:32:05 +08:00
|
|
|
using osu.Framework.Allocation;
|
2023-07-24 17:22:32 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Tests
|
|
|
|
{
|
|
|
|
public abstract partial class TournamentScreenTestScene : TournamentTestScene
|
|
|
|
{
|
2023-07-25 04:07:11 +08:00
|
|
|
protected override Container<Drawable> Content { get; } = new TournamentScalingContainer();
|
2023-07-25 03:32:05 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
base.Content.Add(Content);
|
|
|
|
}
|
2023-07-25 04:07:11 +08:00
|
|
|
|
|
|
|
private partial class TournamentScalingContainer : DrawSizePreservingFillContainer
|
|
|
|
{
|
|
|
|
public TournamentScalingContainer()
|
|
|
|
{
|
|
|
|
TargetDrawSize = new Vector2(1920, 1080);
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
Scale = new Vector2(Math.Min(1, Content.DrawWidth / (1920 + TournamentSceneManager.CONTROL_AREA_WIDTH)));
|
|
|
|
}
|
|
|
|
}
|
2023-07-24 17:22:32 +08:00
|
|
|
}
|
|
|
|
}
|