mirror of
https://github.com/ppy/osu.git
synced 2025-03-25 18:57:18 +08:00
Change how values are applied to (hopefully) simplify things
This commit is contained in:
parent
74eae3cda3
commit
4e043e7cab
@ -116,7 +116,8 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
TargetDrawSize = new Vector2(1024, 1024 / (game?.BaseAspectRatio ?? 1f));
|
||||
if (game != null)
|
||||
TargetDrawSize = game.ScalingContainerTargetDrawSize;
|
||||
Scale = new Vector2(CurrentScale);
|
||||
Size = new Vector2(1 / CurrentScale);
|
||||
|
||||
|
@ -72,6 +72,7 @@ using osu.Game.Skinning;
|
||||
using osu.Game.Updater;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Utils;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using Sentry;
|
||||
|
||||
@ -814,9 +815,10 @@ namespace osu.Game
|
||||
protected virtual UpdateManager CreateUpdateManager() => new UpdateManager();
|
||||
|
||||
/// <summary>
|
||||
/// The base aspect ratio to use in all <see cref="ScalingContainer"/>s.
|
||||
/// Adjust the globally applied <see cref="DrawSizePreservingFillContainer.TargetDrawSize"/> in every <see cref="ScalingContainer"/>.
|
||||
/// Useful for changing how the game handles different aspect ratios.
|
||||
/// </summary>
|
||||
protected internal virtual float BaseAspectRatio => 4f / 3f;
|
||||
protected internal virtual Vector2 ScalingContainerTargetDrawSize { get; } = new Vector2(1024, 768);
|
||||
|
||||
protected override Container CreateScalingContainer() => new ScalingContainer(ScalingMode.Everything);
|
||||
|
||||
|
@ -11,6 +11,7 @@ using osu.Game;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Updater;
|
||||
using osu.Game.Utils;
|
||||
using osuTK;
|
||||
using UIKit;
|
||||
|
||||
namespace osu.iOS
|
||||
@ -22,7 +23,7 @@ namespace osu.iOS
|
||||
|
||||
public override bool HideUnlicensedContent => true;
|
||||
|
||||
protected override float BaseAspectRatio => (float)(UIScreen.MainScreen.Bounds.Width / UIScreen.MainScreen.Bounds.Height);
|
||||
protected override Vector2 ScalingContainerTargetDrawSize => new Vector2(1024, 1024 * DrawHeight / DrawWidth);
|
||||
|
||||
public OsuGameIOS(AppDelegate appDelegate)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user