began implementing resize while further developing ui system

This commit is contained in:
Harrison Deng 2018-09-11 16:26:38 -05:00
parent 073f3a205d
commit 8d80913fe2
5 changed files with 31 additions and 7 deletions

View File

@ -42,6 +42,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Compile Include="Zer01HD\Game\MainScreen\MainPage.cs" />
<Compile Include="Zer01HD\UI\Page\Page.cs" />
<Compile Include="RhythmBulletGame.cs" />
<Compile Include="Program.cs" />

View File

@ -10,9 +10,9 @@ namespace RhythmBullet
/// </summary>
public class RhythmBulletGame : Game
{
private Screen currentScreen;
public Screen currentScreen;
GraphicsDeviceManager graphics;
private GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
public RhythmBulletGame()
@ -81,5 +81,22 @@ namespace RhythmBullet
base.Draw(gameTime);
}
public int getWidth()
{
return graphics.PreferredBackBufferWidth;
}
public int getHeight()
{
return graphics.PreferredBackBufferHeight;
}
public void resize(int width, int height)
{
graphics.PreferredBackBufferWidth = width;
graphics.PreferredBackBufferHeight = height;
}
}
}

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.Game.MainScreen
{
class MainPage : Page
public class MainPage : Page
{
public MainPage(int pageX, int pageY) : base(pageX, pageY)
{

View File

@ -8,18 +8,19 @@ using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.UI
{
class Page
public class Page
{
private readonly int pageX, pageY;
public readonly int xPos, yPos;
public Page(int pageX, int pageY)
{
this.pageX = pageX;
this.pageY = pageY;
}
}
public void Update(GameTime gameTime)
{
}
public void Draw(SpriteBatch batch)

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.UI.Screen
{
class Screen
public class Screen
{
public void Update(GameTime gameTime)
{
@ -29,5 +29,10 @@ namespace RhythmBullet.Zer01HD.UI.Screen
{
}
public void resize()
{
}
}
}