1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 12:17:46 +08:00

Use DrawSize instead of Size whereever Size was previously read due to framework changes.

Note, that this was just stupid replacement. Many components will likely want to actually read Size and not DrawSize. We may want to do a pass over this at some point, but for now everything is working like this. (Old behavior.)
This commit is contained in:
Thomas Müller 2016-10-18 18:53:31 +02:00
parent 3a77fc16c3
commit 68476eafb9
15 changed files with 19 additions and 19 deletions

@ -1 +1 @@
Subproject commit 852df4b405bf40cee0df8f0450a081fa657e7b43 Subproject commit 475c29eeb2250d93197b2d6ef9d0c8d8b408233c

View File

@ -35,7 +35,7 @@ namespace osu.Game.GameModes
{ {
base.Load(game); base.Load(game);
Content.Scale *= 1 + (x_movement_amount / Size.X) * 2; Content.Scale *= 1 + (x_movement_amount / DrawSize.X) * 2;
} }
protected override void OnEntering(GameMode last) protected override void OnEntering(GameMode last)

View File

@ -39,7 +39,7 @@ namespace osu.Game.GameModes
popButton.Alpha = 1; popButton.Alpha = 1;
Content.Alpha = 0; Content.Alpha = 0;
textContainer.Position = new Vector2(Size.X / 16, 0); textContainer.Position = new Vector2(DrawSize.X / 16, 0);
box.ScaleTo(0.2f); box.ScaleTo(0.2f);
box.RotateTo(-20); box.RotateTo(-20);
@ -55,7 +55,7 @@ namespace osu.Game.GameModes
protected override bool OnExiting(GameMode next) protected override bool OnExiting(GameMode next)
{ {
textContainer.MoveTo(new Vector2((Size.X / 16), 0), transition_time, EasingTypes.OutExpo); textContainer.MoveTo(new Vector2((DrawSize.X / 16), 0), transition_time, EasingTypes.OutExpo);
Content.FadeOut(transition_time, EasingTypes.OutExpo); Content.FadeOut(transition_time, EasingTypes.OutExpo);
return base.OnExiting(next); return base.OnExiting(next);
@ -65,7 +65,7 @@ namespace osu.Game.GameModes
{ {
base.OnSuspending(next); base.OnSuspending(next);
textContainer.MoveTo(new Vector2(-(Size.X / 16), 0), transition_time, EasingTypes.OutExpo); textContainer.MoveTo(new Vector2(-(DrawSize.X / 16), 0), transition_time, EasingTypes.OutExpo);
Content.FadeOut(transition_time, EasingTypes.OutExpo); Content.FadeOut(transition_time, EasingTypes.OutExpo);
} }

View File

@ -136,7 +136,7 @@ namespace osu.Game.GameModes.Menu
LoopDelay = duration LoopDelay = duration
}); });
icon.Transforms.Add(new TransformScaleVector(Clock) icon.Transforms.Add(new TransformScale(Clock)
{ {
StartValue = new Vector2(1, 0.9f), StartValue = new Vector2(1, 0.9f),
EndValue = Vector2.One, EndValue = Vector2.One,
@ -158,7 +158,7 @@ namespace osu.Game.GameModes.Menu
LoopDelay = duration LoopDelay = duration
}); });
icon.Transforms.Add(new TransformScaleVector(Clock) icon.Transforms.Add(new TransformScale(Clock)
{ {
StartValue = Vector2.One, StartValue = Vector2.One,
EndValue = new Vector2(1, 0.9f), EndValue = new Vector2(1, 0.9f),

View File

@ -210,7 +210,7 @@ namespace osu.Game.GameModes.Menu
case MenuState.TopLevel: case MenuState.TopLevel:
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out); buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
osuLogo.MoveTo(buttonFlow.Position, 200, EasingTypes.In); osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In); osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
buttonArea.FadeIn(300); buttonArea.FadeIn(300);

View File

@ -24,7 +24,7 @@ namespace osu.Game.GameModes.Menu
if (CentreTarget == null) if (CentreTarget == null)
return base.OriginPosition; return base.OriginPosition;
return CentreTarget.Position + CentreTarget.Size / 2; return CentreTarget.DrawPosition + CentreTarget.DrawSize / 2;
} }
} }
} }

View File

@ -24,7 +24,7 @@ namespace osu.Game.GameModes.Menu
public Action Action; public Action Action;
public float SizeForFlow => logo == null ? 0 : logo.Size.X * logo.Scale.X * logoBounceContainer.Scale.X * 0.8f; public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * 0.8f;
private Sprite ripple; private Sprite ripple;

View File

@ -41,7 +41,7 @@ namespace osu.Game.Graphics.Background
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
BackgroundSprite.Scale = new Vector2(Math.Max(Size.X / BackgroundSprite.Size.X, Size.Y / BackgroundSprite.Size.Y)); BackgroundSprite.Scale = new Vector2(Math.Max(DrawSize.X / BackgroundSprite.DrawSize.X, DrawSize.Y / BackgroundSprite.DrawSize.Y));
} }
} }
} }

View File

@ -34,7 +34,7 @@ namespace osu.Game.Graphics.Containers
protected override bool OnMouseMove(InputState state) protected override bool OnMouseMove(InputState state)
{ {
content.Position = (state.Mouse.Position - Size / 2) * ParallaxAmount; content.Position = (state.Mouse.Position - DrawSize / 2) * ParallaxAmount;
return base.OnMouseMove(state); return base.OnMouseMove(state);
} }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Graphics.Processing
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
Vector2 parent = Parent.Size; Vector2 parent = Parent.DrawSize;
Scale = new Vector2(Math.Min(parent.Y / 768f, parent.X / 1024f)); Scale = new Vector2(Math.Min(parent.Y / 768f, parent.X / 1024f));
Size = new Vector2(1 / Scale.X); Size = new Vector2(1 / Scale.X);

View File

@ -107,8 +107,8 @@ namespace osu.Game.Graphics.UserInterface
}; };
//Set this manually because an element with Alpha=0 won't take it size to AutoSizeContainer, //Set this manually because an element with Alpha=0 won't take it size to AutoSizeContainer,
//so the size can be changing between buttonSprite and glowSprite. //so the size can be changing between buttonSprite and glowSprite.
Height = buttonSprite.Height; Height = buttonSprite.DrawHeight;
Width = buttonSprite.Width; Width = buttonSprite.DrawWidth;
} }
private void updateGlowSprite(bool show) private void updateGlowSprite(bool show)

View File

@ -144,7 +144,7 @@ namespace osu.Game.Overlays
protected override void PopOut() protected override void PopOut()
{ {
MoveToY(-Size.Y, transition_length, EasingTypes.InQuint); MoveToY(-DrawSize.Y, transition_length, EasingTypes.InQuint);
FadeOut(transition_length, EasingTypes.InQuint); FadeOut(transition_length, EasingTypes.InQuint);
} }
} }

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays
protected override void PopOut() protected override void PopOut()
{ {
MoveToY(-Size.Y, transition_time, EasingTypes.InQuint); MoveToY(-DrawSize.Y, transition_time, EasingTypes.InQuint);
FadeOut(transition_time, EasingTypes.InQuint); FadeOut(transition_time, EasingTypes.InQuint);
} }

View File

@ -121,7 +121,7 @@ namespace osu.Game.Overlays
base.Update(); base.Update();
//todo: find a way to avoid using this (autosize needs to be able to ignore certain drawables.. in this case the tooltip) //todo: find a way to avoid using this (autosize needs to be able to ignore certain drawables.. in this case the tooltip)
Size = new Vector2(WIDTH + (DrawableText.IsVisible ? DrawableText.Size.X : 0), 1); Size = new Vector2(WIDTH + (DrawableText.IsVisible ? DrawableText.DrawSize.X : 0), 1);
} }
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)

View File

@ -96,7 +96,7 @@ namespace osu.Game.Overlays
base.UpdateLayout(); base.UpdateLayout();
if (!activeMode.EnsureValid()) if (!activeMode.EnsureValid())
activeMode.Refresh(() => modeButtonLine.MoveToX(activeButton.Position.X + activeButton.Size.X / 2 + padding, 200, EasingTypes.OutQuint)); activeMode.Refresh(() => modeButtonLine.MoveToX(activeButton.DrawPosition.X + activeButton.DrawSize.X / 2 + padding, 200, EasingTypes.OutQuint));
} }
} }
} }