Loading screen base set up.
This commit is contained in:
parent
3779f220ff
commit
7735445888
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ with.
|
||||
<!--
|
||||
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
|
||||
|
@ -643,18 +643,6 @@
|
||||
/processorParam:TextureFormat=Color
|
||||
/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
|
||||
/importer:FontDescriptionImporter
|
||||
/processor:FontDescriptionProcessor
|
||||
@ -676,3 +664,15 @@
|
||||
/processorParam:TextureFormat=Compressed
|
||||
/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
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@ -42,6 +42,8 @@
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<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\ModuleGroup.cs" />
|
||||
<Compile Include="RhythmBulletGame.cs" />
|
||||
@ -115,9 +117,7 @@
|
||||
</None>
|
||||
<None Include="app.manifest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Zer01HD\Game\MainScreen\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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.
|
||||
|
@ -1,7 +1,9 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using RhythmBullet.Zer01HD.Game;
|
||||
using RhythmBullet.Zer01HD.UI;
|
||||
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
|
||||
|
||||
namespace RhythmBullet
|
||||
{
|
||||
@ -10,10 +12,11 @@ namespace RhythmBullet
|
||||
/// </summary>
|
||||
public class RhythmBulletGame : Game
|
||||
{
|
||||
private GraphicsDeviceManager graphics;
|
||||
public GraphicsDeviceManager Graphics;
|
||||
SpriteBatch spriteBatch;
|
||||
|
||||
Screen currentScreen
|
||||
public readonly ContentSystem Assets;
|
||||
private Screen currentScreen;
|
||||
Screen CurrentScreen
|
||||
{
|
||||
get
|
||||
{
|
||||
@ -21,18 +24,23 @@ namespace RhythmBullet
|
||||
}
|
||||
set
|
||||
{
|
||||
currentScreen.Hide();
|
||||
if (currentScreen != null)
|
||||
{
|
||||
CurrentScreen.Hide();
|
||||
}
|
||||
currentScreen = value;
|
||||
currentScreen.Show();
|
||||
CurrentScreen.Show();
|
||||
}
|
||||
}
|
||||
|
||||
public RhythmBulletGame()
|
||||
{
|
||||
graphics = new GraphicsDeviceManager(this);
|
||||
Graphics = new GraphicsDeviceManager(this);
|
||||
Graphics.PreferredBackBufferWidth = 320;
|
||||
Graphics.PreferredBackBufferHeight = 320;
|
||||
Window.IsBorderless = true;
|
||||
Content.RootDirectory = "Content";
|
||||
graphics.PreferredBackBufferWidth = 1920;
|
||||
graphics.PreferredBackBufferHeight = 1080;
|
||||
Assets = new ContentSystem(Content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -55,6 +63,7 @@ namespace RhythmBullet
|
||||
{
|
||||
// Create a new SpriteBatch, which can be used to draw textures.
|
||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
CurrentScreen = new LoadingScreen(Content.Load<Texture2D>("recrown"));
|
||||
|
||||
// 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>
|
||||
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);
|
||||
}
|
||||
|
||||
@ -88,30 +94,19 @@ namespace RhythmBullet
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
GraphicsDevice.Clear(Color.CornflowerBlue);
|
||||
|
||||
GraphicsDevice.Clear(Color.White);
|
||||
spriteBatch.Begin();
|
||||
currentScreen.Draw(spriteBatch);
|
||||
CurrentScreen.Draw(spriteBatch);
|
||||
spriteBatch.End();
|
||||
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
|
||||
public int getWidth()
|
||||
public void Resize(int width, int height)
|
||||
{
|
||||
return graphics.PreferredBackBufferWidth;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return graphics.PreferredBackBufferHeight;
|
||||
}
|
||||
|
||||
public void resize(int width, int height)
|
||||
{
|
||||
graphics.PreferredBackBufferWidth = width;
|
||||
graphics.PreferredBackBufferHeight = height;
|
||||
|
||||
Graphics.PreferredBackBufferWidth = width;
|
||||
Graphics.PreferredBackBufferHeight = height;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
27
RhythmBullet/Zer01HD/Game/LoadingScreen.cs
Normal file
27
RhythmBullet/Zer01HD/Game/LoadingScreen.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
20
RhythmBullet/Zer01HD/Game/MainScreen/MainScreen.cs
Normal file
20
RhythmBullet/Zer01HD/Game/MainScreen/MainScreen.cs
Normal 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -21,16 +21,16 @@ namespace RhythmBullet.Zer01HD.UI.Book
|
||||
|
||||
public virtual void ApplySize(int width, int height)
|
||||
{
|
||||
X = pageX * width;
|
||||
Y = pageY * height;
|
||||
Position.X = pageX * width;
|
||||
Position.Y = pageY * height;
|
||||
this.Width = width;
|
||||
this.Height = height;
|
||||
}
|
||||
|
||||
public void DisplayWithViewport(Viewport viewport)
|
||||
{
|
||||
viewport.X = X;
|
||||
viewport.Y = Y;
|
||||
viewport.X = (int) Position.X;
|
||||
viewport.Y = (int) Position.Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user