2023-07-24 09:22:32 +00: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-24 20:07:11 +00:00
|
|
|
using System;
|
2023-07-24 19:32:05 +00:00
|
|
|
using osu.Framework.Allocation;
|
2023-07-24 09:22:32 +00: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-24 20:07:11 +00:00
|
|
|
protected override Container<Drawable> Content { get; } = new TournamentScalingContainer();
|
2023-07-24 19:32:05 +00:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
base.Content.Add(Content);
|
|
|
|
}
|
2023-07-24 20:07:11 +00:00
|
|
|
|
|
|
|
private partial class TournamentScalingContainer : DrawSizePreservingFillContainer
|
|
|
|
{
|
|
|
|
public TournamentScalingContainer()
|
|
|
|
{
|
2023-08-31 09:46:47 +00:00
|
|
|
TargetDrawSize = new Vector2(1024, 768);
|
2023-07-24 20:07:11 +00:00
|
|
|
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 09:22:32 +00:00
|
|
|
}
|
|
|
|
}
|