Loading screen base set up.

This commit is contained in:
Harrison Deng 2018-09-15 14:05:14 -05:00
parent 3779f220ff
commit 7735445888
16 changed files with 99 additions and 57 deletions

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/darktech_ldr.ttf</FontName> <FontName>Darktech LDR</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/gasalt_regular.ttf</FontName> <FontName>Gasalt</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/iron_maiden.ttf</FontName> <FontName>Iron Maiden</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/darktech_ldr.ttf</FontName> <FontName>Darktech LDR</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/gasalt_regular.ttf</FontName> <FontName>Gasalt</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/iron_maiden.ttf</FontName> <FontName>Iron Maiden</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/darktech_ldr.ttf</FontName> <FontName>Darktech LDR</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/gasalt_regular.ttf</FontName> <FontName>Gasalt</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -11,7 +11,7 @@ with.
<!-- <!--
Modify this string to change the font that will be imported. Modify this string to change the font that will be imported.
--> -->
<FontName>fonts/iron_maiden.ttf</FontName> <FontName>Iron Maiden</FontName>
<!-- <!--
Size is a float value, measured in points. Modify this value to change Size is a float value, measured in points. Modify this value to change

View File

@ -643,18 +643,6 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:defaultCover.png /build:defaultCover.png
#begin splash_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:splash_texture.png
#begin 1920x1080/fonts/darktech_ldr.spritefont #begin 1920x1080/fonts/darktech_ldr.spritefont
/importer:FontDescriptionImporter /importer:FontDescriptionImporter
/processor:FontDescriptionProcessor /processor:FontDescriptionProcessor
@ -676,3 +664,15 @@
/processorParam:TextureFormat=Compressed /processorParam:TextureFormat=Compressed
/build:1920x1080/fonts/iron_maiden.spritefont /build:1920x1080/fonts/iron_maiden.spritefont
#begin recrown.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:recrown.png

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -42,6 +42,8 @@
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Zer01HD\Game\LoadingScreen.cs" />
<Compile Include="Zer01HD\Game\MainScreen\MainScreen.cs" />
<Compile Include="Zer01HD\UI\Modular\Module.cs" /> <Compile Include="Zer01HD\UI\Modular\Module.cs" />
<Compile Include="Zer01HD\UI\Modular\ModuleGroup.cs" /> <Compile Include="Zer01HD\UI\Modular\ModuleGroup.cs" />
<Compile Include="RhythmBulletGame.cs" /> <Compile Include="RhythmBulletGame.cs" />
@ -115,9 +117,7 @@
</None> </None>
<None Include="app.manifest" /> <None Include="app.manifest" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<Folder Include="Zer01HD\Game\MainScreen\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" /> <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,7 +1,9 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using RhythmBullet.Zer01HD.Game;
using RhythmBullet.Zer01HD.UI; using RhythmBullet.Zer01HD.UI;
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
namespace RhythmBullet namespace RhythmBullet
{ {
@ -10,10 +12,11 @@ namespace RhythmBullet
/// </summary> /// </summary>
public class RhythmBulletGame : Game public class RhythmBulletGame : Game
{ {
private GraphicsDeviceManager graphics; public GraphicsDeviceManager Graphics;
SpriteBatch spriteBatch; SpriteBatch spriteBatch;
public readonly ContentSystem Assets;
Screen currentScreen private Screen currentScreen;
Screen CurrentScreen
{ {
get get
{ {
@ -21,18 +24,23 @@ namespace RhythmBullet
} }
set set
{ {
currentScreen.Hide(); if (currentScreen != null)
{
CurrentScreen.Hide();
}
currentScreen = value; currentScreen = value;
currentScreen.Show(); CurrentScreen.Show();
} }
} }
public RhythmBulletGame() public RhythmBulletGame()
{ {
graphics = new GraphicsDeviceManager(this); Graphics = new GraphicsDeviceManager(this);
Graphics.PreferredBackBufferWidth = 320;
Graphics.PreferredBackBufferHeight = 320;
Window.IsBorderless = true;
Content.RootDirectory = "Content"; Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = 1920; Assets = new ContentSystem(Content);
graphics.PreferredBackBufferHeight = 1080;
} }
/// <summary> /// <summary>
@ -55,6 +63,7 @@ namespace RhythmBullet
{ {
// Create a new SpriteBatch, which can be used to draw textures. // Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice); spriteBatch = new SpriteBatch(GraphicsDevice);
CurrentScreen = new LoadingScreen(Content.Load<Texture2D>("recrown"));
// TODO: use this.Content to load your game content here // TODO: use this.Content to load your game content here
} }
@ -75,10 +84,7 @@ namespace RhythmBullet
/// <param name="gameTime">Provides a snapshot of timing values.</param> /// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime) protected override void Update(GameTime gameTime)
{ {
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); CurrentScreen.Update(gameTime);
currentScreen.Update(gameTime);
base.Update(gameTime); base.Update(gameTime);
} }
@ -88,29 +94,18 @@ namespace RhythmBullet
/// <param name="gameTime">Provides a snapshot of timing values.</param> /// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime) protected override void Draw(GameTime gameTime)
{ {
GraphicsDevice.Clear(Color.CornflowerBlue); GraphicsDevice.Clear(Color.White);
spriteBatch.Begin(); spriteBatch.Begin();
currentScreen.Draw(spriteBatch); CurrentScreen.Draw(spriteBatch);
spriteBatch.End(); spriteBatch.End();
base.Draw(gameTime); base.Draw(gameTime);
} }
public int getWidth() public void Resize(int width, int height)
{ {
return graphics.PreferredBackBufferWidth; Graphics.PreferredBackBufferWidth = width;
} Graphics.PreferredBackBufferHeight = height;
public int getHeight()
{
return graphics.PreferredBackBufferHeight;
}
public void resize(int width, int height)
{
graphics.PreferredBackBufferWidth = width;
graphics.PreferredBackBufferHeight = height;
} }
} }

View File

@ -0,0 +1,27 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Zer01HD.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.Game
{
class LoadingScreen : Screen
{
Texture2D recrown;
public LoadingScreen(Texture2D recrown)
{
this.recrown = recrown;
}
public override void Draw(SpriteBatch spriteBatch)
{
spriteBatch.Draw(recrown, recrown.Bounds, Color.White);
base.Draw(spriteBatch);
}
}
}

View File

@ -0,0 +1,20 @@
using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Zer01HD.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.Game.MainScreen
{
class MainScreen : Screen
{
Viewport viewport = new Viewport();
public MainScreen()
{
}
}
}

View File

@ -21,16 +21,16 @@ namespace RhythmBullet.Zer01HD.UI.Book
public virtual void ApplySize(int width, int height) public virtual void ApplySize(int width, int height)
{ {
X = pageX * width; Position.X = pageX * width;
Y = pageY * height; Position.Y = pageY * height;
this.Width = width; this.Width = width;
this.Height = height; this.Height = height;
} }
public void DisplayWithViewport(Viewport viewport) public void DisplayWithViewport(Viewport viewport)
{ {
viewport.X = X; viewport.X = (int) Position.X;
viewport.Y = Y; viewport.Y = (int) Position.Y;
} }
} }
} }