From 8d80913fe258ad55e8a0a40bcc149a822507fce6 Mon Sep 17 00:00:00 2001 From: Recrown Date: Tue, 11 Sep 2018 16:26:38 -0500 Subject: [PATCH] began implementing resize while further developing ui system --- RhythmBullet/RhythmBullet.csproj | 1 + RhythmBullet/RhythmBulletGame.cs | 21 +++++++++++++++++-- .../Zer01HD/Game/MainScreen/MainPage.cs | 2 +- RhythmBullet/Zer01HD/UI/Page/Page.cs | 7 ++++--- RhythmBullet/Zer01HD/UI/Screen/Screen.cs | 7 ++++++- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/RhythmBullet/RhythmBullet.csproj b/RhythmBullet/RhythmBullet.csproj index d1e7e6b..077b008 100644 --- a/RhythmBullet/RhythmBullet.csproj +++ b/RhythmBullet/RhythmBullet.csproj @@ -42,6 +42,7 @@ app.manifest + diff --git a/RhythmBullet/RhythmBulletGame.cs b/RhythmBullet/RhythmBulletGame.cs index a8bff22..b72e2d1 100644 --- a/RhythmBullet/RhythmBulletGame.cs +++ b/RhythmBullet/RhythmBulletGame.cs @@ -10,9 +10,9 @@ namespace RhythmBullet /// 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; + + } } } diff --git a/RhythmBullet/Zer01HD/Game/MainScreen/MainPage.cs b/RhythmBullet/Zer01HD/Game/MainScreen/MainPage.cs index ab2404c..d5157cc 100644 --- a/RhythmBullet/Zer01HD/Game/MainScreen/MainPage.cs +++ b/RhythmBullet/Zer01HD/Game/MainScreen/MainPage.cs @@ -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) { diff --git a/RhythmBullet/Zer01HD/UI/Page/Page.cs b/RhythmBullet/Zer01HD/UI/Page/Page.cs index 2c7fcb8..00eb8d4 100644 --- a/RhythmBullet/Zer01HD/UI/Page/Page.cs +++ b/RhythmBullet/Zer01HD/UI/Page/Page.cs @@ -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) diff --git a/RhythmBullet/Zer01HD/UI/Screen/Screen.cs b/RhythmBullet/Zer01HD/UI/Screen/Screen.cs index 5a4154e..27bc6ee 100644 --- a/RhythmBullet/Zer01HD/UI/Screen/Screen.cs +++ b/RhythmBullet/Zer01HD/UI/Screen/Screen.cs @@ -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() + { + + } } }