Skip to content

Commit

Permalink
Merge pull request #28 from Altenhh/scaling-issue
Browse files Browse the repository at this point in the history
Fix scaling issue
  • Loading branch information
naoei committed Mar 16, 2020
2 parents 0f41f3e + 4a55887 commit 9785ec7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osuTK;
using osuTK.Graphics;
using System.Linq;
using osu.Game.Rulesets.Tau.UI;

namespace osu.Game.Rulesets.Tau.Objects.Drawables
{
Expand Down Expand Up @@ -44,6 +45,7 @@ public DrawabletauHitObject(TauHitObject hitObject)
Size = new Vector2(10);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
RelativePositionAxes = Axes.Both;

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

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

protected override void CheckForResult(bool userTriggered, double timeOffset)
Expand Down
22 changes: 18 additions & 4 deletions osu.Game.Rulesets.tau/UI/tauPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class TauPlayfield : Playfield
private JudgementContainer<DrawableTauJudgement> judgementLayer;
private readonly Container<KiaiHitExplosion> kiaiExplosionContainer;

public const float UNIVERSAL_SCALE = 0.6f;

public TauPlayfield()
{
cursor = new TauCursor();
Expand All @@ -48,7 +50,7 @@ public TauPlayfield()
{
Colour = Color4.Black,
RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.6f),
Size = new Vector2(UNIVERSAL_SCALE),
FillAspectRatio = 1,
FillMode = FillMode.Fit,
Anchor = Anchor.Centre,
Expand All @@ -57,7 +59,7 @@ public TauPlayfield()
new Container
{
RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.6f),
Size = new Vector2(UNIVERSAL_SCALE),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
Expand All @@ -81,7 +83,19 @@ public TauPlayfield()
},
}
},
HitObjectContainer,
new Container
{
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
FillAspectRatio = 1,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(UNIVERSAL_SCALE),
Children = new Drawable[]
{
HitObjectContainer,
}
},
cursor,
kiaiExplosionContainer = new Container<KiaiHitExplosion>
{
Expand Down Expand Up @@ -168,7 +182,7 @@ private class VisualisationContainer : BeatSyncedContainer
private void load(TauRulesetConfigManager settings)
{
RelativeSizeAxes = Axes.Both;
Size = new Vector2(0.6f);
Size = new Vector2(UNIVERSAL_SCALE);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;

Expand Down

0 comments on commit 9785ec7

Please sign in to comment.