Transition to .Net Core and VSCode in progress.

This commit is contained in:
2019-05-31 01:32:25 -05:00
parent f7aa272d76
commit 86a4db5973
25 changed files with 593 additions and 506 deletions

27
RhythmBullet/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,27 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/RhythmBullet.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}

36
RhythmBullet/.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,36 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/RhythmBullet.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/RhythmBullet.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/RhythmBullet.csproj"
],
"problemMatcher": "$tsc"
}
]
}

View File

@@ -1,6 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.Camera;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.UI.Modular;
using System;
@@ -28,7 +27,7 @@ namespace RhythmBullet.Audio.Visualizer
binsPerBar = tsp.GetCurrentSpectrum().Length / BAR_COUNT;
barValue = new int[BAR_COUNT];
rectangleRenderer = new RectangleRenderer();
rectangleRenderer = new RectangleRenderer(graphicsDevice);
}
public override void Update(GameTime gameTime)
@@ -39,7 +38,7 @@ namespace RhythmBullet.Audio.Visualizer
base.Update(gameTime);
}
public override void Draw(SpriteBatch batch)
public override void Draw(ConsistentSpriteBatch batch)
{
if (disposed) throw new ObjectDisposedException(GetType().Name);
rectangleRenderer.Begin(true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

View File

@@ -0,0 +1,79 @@
{
"regions": [
{
"name": "rectangle-button-disabled",
"bounds": {
"X": 0,
"Y": 0,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
},
{
"name": "rectangle-button-down",
"bounds": {
"X": 0,
"Y": 16,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
},
{
"name": "rectangle-button-highlighted",
"bounds": {
"X": 0,
"Y": 32,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
},
{
"name": "rectangle-button",
"bounds": {
"X": 0,
"Y": 48,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
},
{
"name": "ScrollBar",
"bounds": {
"X": 16,
"Y": 0,
"Width": 16,
"Height": 16
},
"ninePatchData": null
}
],
"textureName": "Content-texture.png"
}

View File

@@ -760,3 +760,15 @@
/processor:TextureAtlasProcessor
/build:UI.tatlas
#begin UI-texture.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:UI-texture.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

View File

@@ -9,7 +9,7 @@
"Height": 16
},
"ninePatchData": {
"textureName": "rectangle-button-disabled.png",
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
@@ -25,7 +25,7 @@
"Height": 16
},
"ninePatchData": {
"textureName": "rectangle-button-down.png",
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
@@ -41,7 +41,7 @@
"Height": 16
},
"ninePatchData": {
"textureName": "rectangle-button-highlighted.png",
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
@@ -49,15 +49,25 @@
}
},
{
"name": "rectangle-button",
"name": "rectangle-button-texture",
"bounds": {
"X": 0,
"Y": 48,
"Width": 16,
"Height": 16
},
"ninePatchData": null
},
{
"name": "ScrollBar",
"bounds": {
"X": 16,
"Y": 0,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": "rectangle-button.png",
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
@@ -65,5 +75,5 @@
}
}
],
"textureName": "UI.png"
"textureName": "UI-texture.png"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

View File

@@ -0,0 +1,69 @@
{
"regions": [
{
"name": "rectangle-button-disabled",
"bounds": {
"X": 0,
"Y": 0,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
},
{
"name": "rectangle-button-down",
"bounds": {
"X": 0,
"Y": 16,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
},
{
"name": "rectangle-button-highlighted",
"bounds": {
"X": 0,
"Y": 32,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
},
{
"name": "rectangle-button",
"bounds": {
"X": 0,
"Y": 48,
"Width": 16,
"Height": 16
},
"ninePatchData": {
"textureName": null,
"left": 4,
"right": 4,
"bottom": 4,
"top": 4
}
}
],
"textureName": "-texture.png"
}

View File

@@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RhythmBullet")]
[assembly: AssemblyProduct("RhythmBullet")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("78eb6f5c-0f37-458a-9928-0fd0799c93a5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,160 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4242553D-40F9-40F0-9AE6-CB6771DD9CF9}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RhythmBullet</RootNamespace>
<AssemblyName>RhythmBullet</AssemblyName>
<FileAlignment>512</FileAlignment>
<MonoGamePlatform>DesktopGL</MonoGamePlatform>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE;LINUX</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>TRACE;LINUX</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Audio\MusicController.cs" />
<Compile Include="Audio\MusicList.cs" />
<Compile Include="Audio\SupportedFormats.cs" />
<Compile Include="Audio\TransparentSampleProvider.cs" />
<Compile Include="Audio\Visualizer\ReflectedHorizontalVisualizer.cs" />
<Compile Include="ContentResolvers\FontContentResolver.cs" />
<Compile Include="ContentResolvers\ResolutionContentResolver.cs" />
<Compile Include="Screens\MainMenu\MainPage.cs" />
<Compile Include="Screens\Transitions\FadeAwayTransition.cs" />
<Compile Include="Screens\MainMenu\MainScreen.cs" />
<Compile Include="RhythmBulletGame.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Preferences\Controls.cs" />
<Compile Include="Preferences\General.cs" />
<MonoGameContentReference Include="**\*.mgcb"/>
</ItemGroup>
<ItemGroup>
<Reference Include="BulletSharp, Version=0.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\BulletSharp.0.11.1\lib\net40-client\BulletSharp.dll</HintPath>
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.4"/>
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7"/>
<PackageReference Include="NAudio" Version="1.9.0"/>
<Reference Include="RecrownedAthenaeum">
<HintPath>../References/RecrownedAthenaeum.dll</HintPath>
</Reference>
<Reference Include="MonoGame.Framework, Version=3.7.1.189, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\lib\net45\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="NAudio, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NAudio.1.9.0-preview2\lib\net35\NAudio.dll</HintPath>
</Reference>
<Reference Include="RecrownedAthenaeum, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\RecrownedAthenaeum.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Icon.bmp" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="Content\Content.mgcb" />
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\SDL2.dll">
<Link>x86\SDL2.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\SDL2.dll">
<Link>x64\SDL2.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\soft_oal.dll">
<Link>x86\soft_oal.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\soft_oal.dll">
<Link>x64\soft_oal.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\libSDL2-2.0.so.0">
<Link>x86\libSDL2-2.0.so.0</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\libSDL2-2.0.so.0">
<Link>x64\libSDL2-2.0.so.0</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\libopenal.so.1">
<Link>x86\libopenal.so.1</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\libopenal.so.1">
<Link>x64\libopenal.so.1</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\libSDL2-2.0.0.dylib">
<Link>libSDL2-2.0.0.dylib</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\libopenal.1.dylib">
<Link>libopenal.1.dylib</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\MonoGame.Framework.dll.config">
<Link>MonoGame.Framework.dll.config</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="app.manifest" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<Import Project="..\packages\BulletSharp.0.11.1\build\net40-client\BulletSharp.targets" Condition="Exists('..\packages\BulletSharp.0.11.1\build\net40-client\BulletSharp.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\BulletSharp.0.11.1\build\net40-client\BulletSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\BulletSharp.0.11.1\build\net40-client\BulletSharp.targets'))" />
<Error Condition="!Exists('..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets'))" />
</Target>
<Import Project="..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets" Condition="Exists('..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\build\MonoGame.Framework.DesktopGL.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,9 +1,8 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using RecrownedAthenaeum.Camera;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.ContentSystem;
using RecrownedAthenaeum.Data;
using RecrownedAthenaeum.Input;
using RecrownedAthenaeum.Persistence;
using RecrownedAthenaeum.ScreenSystem;
@@ -30,13 +29,15 @@ namespace RhythmBullet
public static int pixels_per_WU;
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
ConsistentSpriteBatch spriteBatch;
public readonly ContentManagerController assets;
readonly ResolutionContentResolver resolutionContentResolver;
public PreferencesManager preferencesManager;
private ScreenManager screenManager;
public Camera2D Camera { get; private set; }
public BasicEffect cameraEffect;
private bool resizing;
private bool initialLoadComplete;
private MainScreen mainScreen;
@@ -63,7 +64,6 @@ namespace RhythmBullet
Resolution resolution = preferencesManager.GetPreferences<General>().Resolution;
graphics.PreferredBackBufferWidth = resolution.Width;
graphics.PreferredBackBufferHeight = resolution.Height;
RecrownedAthenaeum.Configuration.GraphicsDeviceManager = graphics;
}
/// <summary>
@@ -82,8 +82,14 @@ namespace RhythmBullet
musicController.musicList.StartSearch();
if ((general.skinName ) != null)
{
skinManager.LoadSkin(skinManager.ReadSkinData(general.skinDirectory + general.skinName), general.skinDirectory + general.skinName);
skinManager.LoadSkin(Path.Combine(general.skinDirectory, general.skinName), graphics.GraphicsDevice);
}
Debug.WriteLine("Initial resolution: " + resolution);
cameraEffect = new BasicEffect(graphics.GraphicsDevice);
cameraEffect.TextureEnabled = true;
cameraEffect.VertexColorEnabled = true;
Camera = new Camera2D(resolution.Width, resolution.Height, cameraEffect);
Debug.WriteLine("Initial setup complete.");
base.Initialize();
}
@@ -95,14 +101,10 @@ namespace RhythmBullet
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
spriteBatch = new ConsistentSpriteBatch(GraphicsDevice);
RecrownedAthenaeum.Configuration.Camera2D = new Camera2D();
Camera = RecrownedAthenaeum.Configuration.Camera2D;
screenManager = new ScreenManager();
RecrownedAthenaeum.Configuration.spriteBatchSettings = screenManager.batchSettings;
screenManager.ShowFirstScreenEvent += ShowFirstScreen;
screenManager = new ScreenManager(graphics);
screenManager.NeedNextScreen += ShowFirstScreen;
QueueContent();
screenManager.Screen = new LoadingScreen(this, Content.Load<Texture2D>("RhythmBullet"), 0.7f);
}
@@ -140,7 +142,7 @@ namespace RhythmBullet
{
assets.Update();
}
screenManager.UpdateCurrentScreen(gameTime, CheckReadyForInitiate());
screenManager.UpdateCurrentScreen(gameTime, !CheckReadyForInitiate());
InputUtilities.Update();
base.Update(gameTime);
@@ -152,7 +154,8 @@ namespace RhythmBullet
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
screenManager.DrawCurrentScreen(spriteBatch);
spriteBatch.effect = cameraEffect;
screenManager.DrawScreen(spriteBatch);
base.Draw(gameTime);
}
@@ -216,12 +219,13 @@ namespace RhythmBullet
SetUpDefaultSkin();
UpdateCursor();
mainScreen = new MainScreen(assets, Skin);
mainScreen = new MainScreen(assets, Skin, Camera);
initialLoadComplete = true;
}
private void UpdateCursor()
{
SpriteBatch spriteBatch = this.spriteBatch;
Texture2D texture = Skin.CursorTexture;
int cursorSize = (int)(0.07f * graphics.PreferredBackBufferHeight);
Debug.WriteLine("Cursor size length: " + cursorSize);

View File

@@ -1,13 +1,10 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.ContentSystem;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.UI.BookSystem;
using RecrownedAthenaeum.UI.Modular.Modules;
using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
using RecrownedAthenaeum.UI.SkinSystem;
using RecrownedAthenaeum.UI.SkinSystem.Definitions;
using System;
namespace RhythmBullet.Screens.MainMenu
{
@@ -21,7 +18,7 @@ namespace RhythmBullet.Screens.MainMenu
{
}
protected override void Initialize(ContentManagerController assets, ISkin skin)
protected override void Initialize(ContentManagerController assets, ISkin skin, BasicScissor scissorBox)
{
title = new Image(assets.Get<Texture2D>("title"));
AddModule(title);
@@ -33,6 +30,8 @@ namespace RhythmBullet.Screens.MainMenu
quitButton = new TextButton("Quit", font, skin);
AddModule(quitButton);
base.Initialize(assets, skin, scissorBox);
}
public override void ApplySize(int width, int height)
@@ -56,9 +55,11 @@ namespace RhythmBullet.Screens.MainMenu
quitButton.CenterHorizontally();
quitButton.situation.Y = (int)quitButton.origin.Y + playButton.Boundaries.Y + playButton.Boundaries.Height + 15;
base.ApplySize(width, height);
}
public override void Draw(SpriteBatch batch)
public override void Draw(ConsistentSpriteBatch batch)
{
base.Draw(batch);
}

View File

@@ -1,8 +1,8 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.Camera;
using RecrownedAthenaeum.ContentSystem;
using RecrownedAthenaeum.Input;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.ScreenSystem;
using RecrownedAthenaeum.UI.BookSystem;
using RecrownedAthenaeum.UI.SkinSystem;
@@ -17,22 +17,25 @@ namespace RhythmBullet.Screens.MainMenu
readonly Texture2D background;
readonly Book book;
readonly MainPage mainPage;
Rectangle screenSize;
public MainScreen(ContentManagerController assets, ISkin skin) : base(true)
public MainScreen(ContentManagerController assets, ISkin skin, Camera2D camera) : base(true)
{
this.assets = assets;
background = assets.Get<Texture2D>("backgrounds/mainBG");
fat = new FadeAwayTransition(1.5f);
book = new Book(assets, skin);
book = new Book(assets, skin, camera);
mainPage = new MainPage();
book.AddPages(mainPage);
InputUtilities.InputListeners.Add(book);
}
public override void Initiate(Rectangle screenSize, Camera2D camera)
public override void ApplySize(int width, int height)
{
book.Initiate(camera, screenSize);
base.Initiate(screenSize, camera);
screenSize.Width = width;
screenSize.Height = height;
book.ApplySize(width, height);
base.ApplySize(width, height);
}
public override void Show()
@@ -41,9 +44,9 @@ namespace RhythmBullet.Screens.MainMenu
base.Show();
}
public override void Draw(SpriteBatch spriteBatch)
public override void Draw(ConsistentSpriteBatch spriteBatch)
{
spriteBatch.Draw(background, ScreenSize, Color.White);
spriteBatch.Draw(background, screenSize, Color.White);
book.Draw(spriteBatch);
base.Draw(spriteBatch);
}

View File

@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.ScreenSystem;
using System;
@@ -55,7 +56,7 @@ namespace RhythmBullet.Screens.Transitions
return true;
}
public void DrawTransition(SpriteBatch batch)
public void DrawTransition(ConsistentSpriteBatch batch)
{
if (curtain != null)
{

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BulletSharp" version="0.11.1" targetFramework="net45" />
<package id="MonoGame.Framework.DesktopGL" version="3.7.1.189" targetFramework="net45" />
<package id="NAudio" version="1.9.0-preview2" targetFramework="net45" />
</packages>