Skip to content

Commit 9785ec7

Browse files
authored
Merge pull request #28 from Altenhh/scaling-issue
Fix scaling issue
2 parents 0f41f3e + 4a55887 commit 9785ec7

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

osu.Game.Rulesets.tau/Objects/Drawables/DrawabletauHitObject.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using osuTK;
1212
using osuTK.Graphics;
1313
using System.Linq;
14+
using osu.Game.Rulesets.Tau.UI;
1415

1516
namespace osu.Game.Rulesets.Tau.Objects.Drawables
1617
{
@@ -44,6 +45,7 @@ public DrawabletauHitObject(TauHitObject hitObject)
4445
Size = new Vector2(10);
4546
Anchor = Anchor.Centre;
4647
Origin = Anchor.Centre;
48+
RelativePositionAxes = Axes.Both;
4749

4850
AddInternal(Box = new Box
4951
{
@@ -67,7 +69,7 @@ protected override void UpdateInitialTransforms()
6769
var a = b *= (float)(Math.PI / 180);
6870

6971
Box.FadeIn(HitObject.TimeFadeIn);
70-
this.MoveTo(new Vector2(-(215 * (float)Math.Cos(a)), -(215 * (float)Math.Sin(a))), HitObject.TimePreempt);
72+
this.MoveTo(new Vector2(-(TauPlayfield.UNIVERSAL_SCALE * 0.8f * (float)Math.Cos(a)), -(TauPlayfield.UNIVERSAL_SCALE * 0.8f * (float)Math.Sin(a))), HitObject.TimePreempt);
7173
}
7274

7375
protected override void CheckForResult(bool userTriggered, double timeOffset)

osu.Game.Rulesets.tau/UI/tauPlayfield.cs

+18-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public class TauPlayfield : Playfield
3232
private JudgementContainer<DrawableTauJudgement> judgementLayer;
3333
private readonly Container<KiaiHitExplosion> kiaiExplosionContainer;
3434

35+
public const float UNIVERSAL_SCALE = 0.6f;
36+
3537
public TauPlayfield()
3638
{
3739
cursor = new TauCursor();
@@ -48,7 +50,7 @@ public TauPlayfield()
4850
{
4951
Colour = Color4.Black,
5052
RelativeSizeAxes = Axes.Both,
51-
Size = new Vector2(0.6f),
53+
Size = new Vector2(UNIVERSAL_SCALE),
5254
FillAspectRatio = 1,
5355
FillMode = FillMode.Fit,
5456
Anchor = Anchor.Centre,
@@ -57,7 +59,7 @@ public TauPlayfield()
5759
new Container
5860
{
5961
RelativeSizeAxes = Axes.Both,
60-
Size = new Vector2(0.6f),
62+
Size = new Vector2(UNIVERSAL_SCALE),
6163
Anchor = Anchor.Centre,
6264
Origin = Anchor.Centre,
6365
Children = new Drawable[]
@@ -81,7 +83,19 @@ public TauPlayfield()
8183
},
8284
}
8385
},
84-
HitObjectContainer,
86+
new Container
87+
{
88+
RelativeSizeAxes = Axes.Both,
89+
FillMode = FillMode.Fit,
90+
FillAspectRatio = 1,
91+
Anchor = Anchor.Centre,
92+
Origin = Anchor.Centre,
93+
Size = new Vector2(UNIVERSAL_SCALE),
94+
Children = new Drawable[]
95+
{
96+
HitObjectContainer,
97+
}
98+
},
8599
cursor,
86100
kiaiExplosionContainer = new Container<KiaiHitExplosion>
87101
{
@@ -168,7 +182,7 @@ private class VisualisationContainer : BeatSyncedContainer
168182
private void load(TauRulesetConfigManager settings)
169183
{
170184
RelativeSizeAxes = Axes.Both;
171-
Size = new Vector2(0.6f);
185+
Size = new Vector2(UNIVERSAL_SCALE);
172186
Anchor = Anchor.Centre;
173187
Origin = Anchor.Centre;
174188

0 commit comments

Comments
 (0)