Add parallax to ButtonSystem.

This commit is contained in:
Dean Herbert
2016-10-01 17:02:20 +09:00
parent 4ad618abc9
commit 40e5a449bf

View File

@ -6,20 +6,23 @@ using osu.Framework.Audio.Track;
using osu.Framework.GameModes; using osu.Framework.GameModes;
using osu.Framework.GameModes.Testing; using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Transformations;
using osu.Game.GameModes.Charts; using osu.Game.GameModes.Charts;
using osu.Game.GameModes.Direct; using osu.Game.GameModes.Direct;
using osu.Game.GameModes.Edit; using osu.Game.GameModes.Edit;
using osu.Game.GameModes.Multiplayer; using osu.Game.GameModes.Multiplayer;
using osu.Game.GameModes.Play; using osu.Game.GameModes.Play;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using OpenTK;
namespace osu.Game.GameModes.Menu namespace osu.Game.GameModes.Menu
{ {
internal class MainMenu : OsuGameMode internal class MainMenu : OsuGameMode
{ {
private ButtonSystem buttons;
public override string Name => @"Main Menu"; public override string Name => @"Main Menu";
//private AudioTrackBass bgm; private AudioTrack bgm;
public override void Load() public override void Load()
{ {
@ -30,7 +33,12 @@ namespace osu.Game.GameModes.Menu
Children = new Drawable[] Children = new Drawable[]
{ {
new ButtonSystem() new ParallaxContainer
{
ParallaxAmount = 0.01f,
Children = new Drawable[]
{
buttons = new ButtonSystem()
{ {
OnChart = delegate { Push(new ChartListing()); }, OnChart = delegate { Push(new ChartListing()); },
OnDirect = delegate { Push(new OnlineListing()); }, OnDirect = delegate { Push(new OnlineListing()); },
@ -47,6 +55,8 @@ namespace osu.Game.GameModes.Menu
Game.Options.PoppedOut = !Game.Options.PoppedOut; Game.Options.PoppedOut = !Game.Options.PoppedOut;
}, },
} }
}
}
}; };
} }