diff options
Diffstat (limited to 'Penguloon/Controls')
| -rw-r--r-- | Penguloon/Controls/LevelSelector.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Penguloon/Controls/LevelSelector.cs b/Penguloon/Controls/LevelSelector.cs index 6437773..4878e4c 100644 --- a/Penguloon/Controls/LevelSelector.cs +++ b/Penguloon/Controls/LevelSelector.cs @@ -27,17 +27,18 @@ namespace Penguloon.Controls this.BackgroundPressed = ContentManager.GetTexture("UI/btnIdle"); this.BackgroundDisabled = ContentManager.GetTexture("UI/btnIdle"); - PanelWidth = (int)(StaticUIValues.ScreenViewport.X - ((MaxPanels + 1) * PanelMarginX)) / MaxPanels; + PanelWidth = ((int)((StaticUIValues.ScreenViewport.X - ((MaxPanels + 1) * PanelMarginX)) / MaxPanels)); - int panel1posX = PanelMarginX + (PanelMarginX * 0) + (PanelWidth * 0); - int panel2posX = PanelMarginX + (PanelMarginX * 1) + (PanelWidth * 1); - int panel3posX = PanelMarginX + (PanelMarginX * 2) + (PanelWidth * 2); + int panel1posX = (PanelMarginX + (PanelMarginX * 0) + (PanelWidth * 0)) + 20; + int panel2posX = (PanelMarginX + (PanelMarginX * 1) + (PanelWidth * 1)); + int panel3posX = (PanelMarginX + (PanelMarginX * 2) + (PanelWidth * 2)) - 20; int sidePanelMarginY = 25; + int centerPanelWidth = (int)(PanelWidth * 1.2); - Panel1 = new Rectangle(panel1posX, (int)position.Y + (sidePanelMarginY / 2), PanelWidth, (int)size.Y - sidePanelMarginY); - Panel2 = new Rectangle(panel2posX, (int)position.Y, PanelWidth, (int)size.Y); - Panel3 = new Rectangle(panel3posX, (int)position.Y + (sidePanelMarginY / 2), PanelWidth, (int)size.Y - sidePanelMarginY); + Panel1 = new Rectangle(panel1posX, (int)position.Y + (sidePanelMarginY / 2), (int)(PanelWidth * 1), (int)size.Y - sidePanelMarginY); + Panel2 = new Rectangle(panel2posX - ((centerPanelWidth - PanelWidth) / 2), (int)position.Y, centerPanelWidth, (int)size.Y); + Panel3 = new Rectangle(panel3posX, (int)position.Y + (sidePanelMarginY / 2), (int)(PanelWidth * 1), (int)size.Y - sidePanelMarginY); this.OnClick += LevelSelector_OnClick; @@ -69,8 +70,8 @@ namespace Penguloon.Controls private void CreateLevels() { Levels.Add(new IceLevel()); - //Levels.Add(new IceLevel()); - //Levels.Add(new IceLevel()); + Levels.Add(new IceLevel()); + Levels.Add(new IceLevel()); } public override void Draw(float deltaTime) @@ -89,14 +90,14 @@ namespace Penguloon.Controls destinationRectangle: Panel1); } - ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap].SplashArt, - destinationRectangle: Panel2); - if (selectedMap + 1 < Levels.Count) { ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap + 1].SplashArt, destinationRectangle: Panel3); } + + ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap].SplashArt, + destinationRectangle: Panel2); } } }
\ No newline at end of file |
