Add template toolbar.

This commit is contained in:
Dean Herbert 2016-09-30 18:45:27 +09:00
parent 463f606004
commit d93718d953
3 changed files with 44 additions and 1 deletions

View File

@ -1,4 +1,5 @@
using osu.Framework.Graphics;
using osu.Framework.GameModes;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Textures;
@ -18,6 +19,7 @@ public class OsuGameBase : Framework.Game
protected override string MainResourceFile => @"osu.Game.Resources.dll";
public Options Options;
public Toolbar Toolbar;
internal APIAccess API;
@ -48,6 +50,7 @@ public override void Load()
{
Children = new Drawable[]
{
Toolbar = new Toolbar(),
Options = new Options(),
new OsuCursorContainer()
}

View File

@ -0,0 +1,39 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Drawables;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Overlays
{
public class Toolbar : Container
{
const float height = 50;
public override void Load()
{
base.Load();
Depth = float.MaxValue;
SizeMode = InheritMode.X;
Size = new Vector2(1, height);
Children = new Drawable[]
{
new Box
{
SizeMode = InheritMode.XY,
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.9f)
}
};
}
}
}

View File

@ -84,6 +84,7 @@
<Compile Include="OsuGame.cs" />
<Compile Include="OsuGameBase.cs" />
<Compile Include="Overlays\Options.cs" />
<Compile Include="Overlays\Toolbar.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>