Skip to content

Commit

Permalink
Merge pull request #364 from peppy/general-fixes
Browse files Browse the repository at this point in the history
Design improvements
  • Loading branch information
peppy authored Feb 16, 2017
2 parents a3cdbe2 + aaed714 commit ecb840e
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ExplodePiece()
{
BlendingMode = BlendingMode.Additive,
RelativeSizeAxes = Axes.Both,
Alpha = 0.1f,
Alpha = 0.2f,
}
};
}
Expand Down
14 changes: 8 additions & 6 deletions osu.Game.Modes.Osu/UI/OsuScoreOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ public class OsuScoreOverlay : ScoreOverlay
{
protected override ScoreCounter CreateScoreCounter() => new ScoreCounter()
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
TextSize = 60,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
TextSize = 40,
Position = new Vector2(0, 30),
Margin = new MarginPadding { Right = 5 },
};

protected override PercentageCounter CreateAccuracyCounter() => new PercentageCounter()
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Position = new Vector2(0, 55),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Position = new Vector2(0, 65),
TextSize = 20,
Margin = new MarginPadding { Right = 5 },
};

Expand Down
5 changes: 4 additions & 1 deletion osu.Game/Graphics/UserInterface/RollingCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ protected RollingCounter()
{
Children = new Drawable[]
{
DisplayedCountSpriteText = new OsuSpriteText(),
DisplayedCountSpriteText = new OsuSpriteText()
{
Font = @"Venera"
},
};

TextSize = 40;
Expand Down
45 changes: 35 additions & 10 deletions osu.Game/Modes/UI/HealthDisplay.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using OpenTK;
using OpenTK.Graphics;
using System;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using System;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;

namespace osu.Game.Modes.UI
{
public class HealthDisplay : Container
{
private Box background;
private Box fill;
private Container fill;

public BindableDouble Current = new BindableDouble() { MinValue = 0, MaxValue = 1 };
public BindableDouble Current = new BindableDouble()
{
MinValue = 0,
MaxValue = 1
};

public HealthDisplay()
{
Expand All @@ -26,19 +32,38 @@ public HealthDisplay()
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Gray,
Colour = Color4.Black,
},
fill = new Box
fill = new Container
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
Scale = new Vector2(0, 1),
},
Masking = true,
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
}
}
},
};

Current.ValueChanged += current_ValueChanged;
}

[BackgroundDependencyLoader]
private void laod(OsuColour colours)
{
fill.Colour = colours.BlueLighter;
fill.EdgeEffect = new EdgeEffect
{
Colour = colours.BlueDarker.Opacity(0.6f),
Radius = 8,
Type= EdgeEffectType.Glow
};
}

private void current_ValueChanged(object sender, EventArgs e)
{
fill.ScaleTo(new Vector2((float)Current, 1), 200, EasingTypes.OutQuint);
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Modes/UI/ScoreOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public abstract class ScoreOverlay : Container
protected abstract ScoreCounter CreateScoreCounter();
protected virtual HealthDisplay CreateHealthDisplay() => new HealthDisplay
{
Size = new Vector2(0.5f, 20),
Size = new Vector2(1, 5),
RelativeSizeAxes = Axes.X,
Padding = new MarginPadding(5)
Margin = new MarginPadding { Top = 20 }
};

public virtual void OnHit(HitObject h)
Expand Down
3 changes: 2 additions & 1 deletion osu.Game/Screens/Menu/OsuLogo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)

protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{

logoBounceContainer.ScaleTo(1f, 500, EasingTypes.OutElastic);
return true;
}

protected override bool OnDragStart(InputState state) => true;

protected override bool OnClick(InputState state)
{
if (!Interactive) return false;
Expand Down
2 changes: 2 additions & 0 deletions osu.Game/Screens/Play/KeyCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ private void load(TextureStore textures)
new OsuSpriteText
{
Text = Name,
Font = @"Venera",
TextSize = 12,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativePositionAxes = Axes.Both,
Expand Down
2 changes: 2 additions & 0 deletions osu.Game/Screens/Select/Footer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class Footer : Container

private const float padding = 80;

public override bool Contains(Vector2 screenSpacePos) => true;

public Action OnBack;
public Action OnStart;

Expand Down

0 comments on commit ecb840e

Please sign in to comment.