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> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Zer01HD\Game\MainScreen\MainPage.cs" />
<Compile Include="Zer01HD\UI\Page\Page.cs" /> <Compile Include="Zer01HD\UI\Page\Page.cs" />
<Compile Include="RhythmBulletGame.cs" /> <Compile Include="RhythmBulletGame.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />

View File

@ -10,9 +10,9 @@ namespace RhythmBullet
/// </summary> /// </summary>
public class RhythmBulletGame : Game public class RhythmBulletGame : Game
{ {
private Screen currentScreen; public Screen currentScreen;
GraphicsDeviceManager graphics; private GraphicsDeviceManager graphics;
SpriteBatch spriteBatch; SpriteBatch spriteBatch;
public RhythmBulletGame() public RhythmBulletGame()
@ -81,5 +81,22 @@ namespace RhythmBullet
base.Draw(gameTime); 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 namespace RhythmBullet.Zer01HD.Game.MainScreen
{ {
class MainPage : Page public class MainPage : Page
{ {
public MainPage(int pageX, int pageY) : base(pageX, pageY) public MainPage(int pageX, int pageY) : base(pageX, pageY)
{ {

View File

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

View File

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