/// <summary> /// Allows the screen to create the hit bounds for a particular menu entry. /// </summary> protected virtual Rectangle GetMenuEntryHitBounds(LevelEntry entry) { // the hit bounds are the entire width of the screen, and the height of the entry // with some additional padding above and below. return new Rectangle( (int)entry.Position.X, (int)entry.Position.Y, entry.GetWidth(this), entry.GetHeight(this)); }
public override void LoadContent() { base.LoadContent(); if(content == null) content = new ContentManager(ScreenManager.Game.Services,"Content"); LevelEntry lvl1 = new LevelEntry("Level 1", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.BRONZE, this); LevelEntry lvl2 = new LevelEntry("Level 2", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.GOLD, this); LevelEntry lvl3 = new LevelEntry("Level 3", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.SILVER, this); LevelEntry lvl4 = new LevelEntry("Level 4", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.NONE, this); LevelEntry lvl5 = new LevelEntry("Level 5", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.GOLD, this); LevelEntry lvl6 = new LevelEntry("Level 6", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.SILVER, this); LevelEntry lvl7 = new LevelEntry("Level 7", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.LOCKED, this); LevelEntry lvl8 = new LevelEntry("Level 8", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.LOCKED, this); LevelEntry lvl9 = new LevelEntry("Level 9", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.LOCKED, this); LevelEntry lvl10 = new LevelEntry("Level 10", "LevelSelectionIcons_SD\\LevelIcon_SD", Stars.LOCKED, this); lvl1.Selected += LvL1; lvl2.Selected += LvL2; lvl3.Selected += LvL3; lvl4.Selected += LvL4; lvl5.Selected += LvL5; lvl6.Selected += LvL6; lvl7.Selected += LvL7; lvl8.Selected += LvL8; lvl9.Selected += LvL9; lvl10.Selected += LvL10; }