HUD
This commit is contained in:
parent
b848347c56
commit
5b5fd85436
2 changed files with 3 additions and 9 deletions
|
@ -11,7 +11,6 @@ namespace DangerousD.GameCore.GUI
|
||||||
{
|
{
|
||||||
public class HUD : AbstractGui
|
public class HUD : AbstractGui
|
||||||
{
|
{
|
||||||
Button[] buttons = new Button[2];
|
|
||||||
int ammout = 0;
|
int ammout = 0;
|
||||||
List<Rect> rects = new List<Rect> { };
|
List<Rect> rects = new List<Rect> { };
|
||||||
int wigth = AppManager.Instance.inGameResolution.X;
|
int wigth = AppManager.Instance.inGameResolution.X;
|
||||||
|
@ -24,10 +23,6 @@ namespace DangerousD.GameCore.GUI
|
||||||
Elements.Add(rect);
|
Elements.Add(rect);
|
||||||
Label label = new Label(Manager) { rectangle = new Rectangle(wigth / 34, height / 30, 120, 20), text = "ammout", fontName = "font2", scale = 0.2f, mainColor = Color.Transparent, fontColor = Color.Black };
|
Label label = new Label(Manager) { rectangle = new Rectangle(wigth / 34, height / 30, 120, 20), text = "ammout", fontName = "font2", scale = 0.2f, mainColor = Color.Transparent, fontColor = Color.Black };
|
||||||
Elements.Add(label);
|
Elements.Add(label);
|
||||||
buttons[0] = new Button(Manager) { rectangle = new Rectangle(300, 300, 50, 50), text = ammout.ToString() };
|
|
||||||
Elements.Add(buttons[0]);
|
|
||||||
buttons[1] = new Button(Manager) { rectangle = new Rectangle(300, 400, 50, 50) };
|
|
||||||
Elements.Add(buttons[1]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public override void Update(GameTime gameTime)
|
public override void Update(GameTime gameTime)
|
||||||
|
@ -35,8 +30,7 @@ namespace DangerousD.GameCore.GUI
|
||||||
|
|
||||||
rects.Clear();
|
rects.Clear();
|
||||||
for (int i = 0; i < ammout; i++)
|
for (int i = 0; i < ammout; i++)
|
||||||
{ ammout += 1;
|
{
|
||||||
ammout %= 8;
|
|
||||||
rects.Add(new Rect(Manager) { rectangle = new Rectangle(wigth / 29 + i * 13, height / 17, 5, 20), mainColor = Color.Yellow });
|
rects.Add(new Rect(Manager) { rectangle = new Rectangle(wigth / 29 + i * 13, height / 17, 5, 20), mainColor = Color.Yellow });
|
||||||
rects[i].LoadTexture(AppManager.Instance.Content);
|
rects[i].LoadTexture(AppManager.Instance.Content);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,8 @@ namespace DangerousD.GameCore
|
||||||
resolution = SettingsManager.Resolution;
|
resolution = SettingsManager.Resolution;
|
||||||
_graphics.PreferredBackBufferWidth = resolution.X;
|
_graphics.PreferredBackBufferWidth = resolution.X;
|
||||||
_graphics.PreferredBackBufferHeight = resolution.Y;
|
_graphics.PreferredBackBufferHeight = resolution.Y;
|
||||||
//_graphics.IsFullScreen = true;
|
_graphics.IsFullScreen = true;
|
||||||
gameState = GameState.HUD;
|
gameState = GameState.Menu;
|
||||||
MenuGUI = new MenuGUI();
|
MenuGUI = new MenuGUI();
|
||||||
LoginGUI = new LoginGUI();
|
LoginGUI = new LoginGUI();
|
||||||
OptionsGUI = new OptionsGUI();
|
OptionsGUI = new OptionsGUI();
|
||||||
|
|
Loading…
Add table
Reference in a new issue