diff --git a/isometric-park-fna/BudgetWindow.cs b/isometric-park-fna/BudgetWindow.cs --- a/isometric-park-fna/BudgetWindow.cs +++ b/isometric-park-fna/BudgetWindow.cs @@ -18,7 +18,8 @@ private MouseState mousePrev; private static int bar_height = 25; - + private static int height = 500; + private static int width = 700; public BudgetWindow(Budget budget, SpriteFont font, int start_x, int start_y) { @@ -34,7 +35,7 @@ this.budget = budget; if ((mouseCur.LeftButton == ButtonState.Pressed) - && MathUtils.Between(mouseCur.X, 700+x-20, 700+x) + && MathUtils.Between(mouseCur.X, width+x-20, width+x) && MathUtils.Between(mouseCur.Y, y+bar_height, y+bar_height+20) ) { @@ -42,7 +43,7 @@ } else if ((mouseCur.LeftButton == ButtonState.Pressed) - && MathUtils.Between(mouseCur.X, x, 700+x) + && MathUtils.Between(mouseCur.X, x, width+x) && MathUtils.Between(mouseCur.Y, y, 500 + y)) { if (mousePrev.LeftButton == ButtonState.Released) @@ -53,7 +54,7 @@ else { this.mouseEnd = new Vector2(mouseCur.X, mouseCur.Y); - this.x = MathUtils.Clamp(this.x + (int)(this.mouseEnd.X - this.mouseStart.X), 0, 700); + this.x = MathUtils.Clamp(this.x + (int)(this.mouseEnd.X - this.mouseStart.X), 0, width); this.y = MathUtils.Clamp(this.y + (int)(this.mouseEnd.Y - this.mouseStart.Y), 0, 400); } } @@ -62,27 +63,23 @@ this.mousePrev = mouseCur; - // Console.Write(mouseCur.ToString()); - return true; - } public void draw(SpriteBatch batch) { - int height = 500; FilledRectangle.drawFilledRectangle(batch, new Rectangle(x - 20, y+bar_height, 20, height), Color.White); Line.drawLine(batch, new Vector2(x, y + bar_height), new Vector2(x, y + bar_height + height), Color.Gray); - FilledRectangle.drawFilledRectangle(batch, new Rectangle(x + 700, y+bar_height, 20, height), Color.White); - Line.drawLine(batch, new Vector2(x + 700, y + bar_height), new Vector2(x + 700, y + bar_height + height), Color.Gray); + FilledRectangle.drawFilledRectangle(batch, new Rectangle(x + width, y+bar_height, 20, height), Color.White); + Line.drawLine(batch, new Vector2(x + width, y + bar_height), new Vector2(x + width, y + bar_height + height), Color.Gray); for (int i = 1; i <= (height / bar_height); i++) { Rectangle position = new Rectangle(this.x, bar_height * i + this.y, - 700, bar_height); + width, bar_height); if ((i % 2) == 0) { @@ -94,9 +91,9 @@ } } - FilledRectangle.drawFilledRectangle(batch, new Rectangle(x + 700 - 20, y+bar_height, 20, 20), Color.LightGray); + FilledRectangle.drawFilledRectangle(batch, new Rectangle(x + width - 20, y+bar_height, 20, 20), Color.LightGray); Vector2 dimensions = font.MeasureString("X"); - batch.DrawString(font, "X", new Vector2(x+700 -20 + (dimensions.X/2), y+bar_height), Color.Black); + batch.DrawString(font, "X", new Vector2(x+width -20 + (dimensions.X/2), y+bar_height), Color.Black); batch.DrawString(font, String.Format("BUDGET REPORT FOR {0:MMMMM yyyy}", this.budget.DateTime), new Vector2(x, bar_height * 1 + y), Color.Black);