public RobberMenu(int nCards) { this.Width = fWidth; this.Height = fHeight; this.Center = new Vector2(50f, 30f); this.Texture = "RobberMenu"; for (int x = 0; x < oCards.Count(); x++) { oCards[x] = new List <XNACS1Rectangle>(); oCardDisplacements[x] = new List <Vector2>(); } oButton = new XNACS1Rectangle(new Vector2(), Global.PixelSize(111), Global.PixelSize(34)); oButton.UseSpriteSheet = true; oButton.SetTextureSpriteSheet("TradeMenuButtons1", 3, 1, 0); oButton.SetTextureSpriteAnimationFrames(0, 0, 0, 0, 1, SpriteSheetAnimationMode.AnimateForward); oButton.LabelColor = Color.White; oButton.Label = "Accept"; oDiscardCount = new XNACS1Rectangle(new Vector2(), 5f, 5f); oDiscardCount.Color = new Color(0, 0, 0, 0); oDiscardCount.Label = "" + nDiscardsNeeded; oDiscardCount.LabelColor = Color.White; nDiscardsNeeded = (nCards / 2) + (nCards % 2); }
public SmallHUD(Vector2 oDisplacement, int nOwner) { this.Width = fWidth; this.Height = fHeight; this.oDisplacement = oDisplacement; this.Texture = "SmallHUD2"; this.nOwner = nOwner; for (int x = 0; x < nScores.Count(); x++) { oScores[x] = new XNACS1Rectangle(); oScores[x].Color = new Color(0, 0, 0, 0); oScores[x].LabelColor = Color.White; oScores[x].LabelFont = "SmallHUD"; } oScoreDisplacments[0] = new Vector2(2.1f, 0f); oScoreDisplacments[1] = new Vector2(6.05f, 0f); oScoreDisplacments[2] = new Vector2(9.7f, 0f); oScoreDisplacments[3] = new Vector2(2.1f, -2.9f); oScoreDisplacments[4] = new Vector2(6.05f, -2.9f); oName = new XNACS1Rectangle(); oName.Color = new Color(0, 0, 0, 0); oName.LabelColor = Color.White; oName.Label = "BillyBobHobo"; oNameDisplacement = new Vector2(Global.PixelSize(45), Global.PixelSize(27)); oName.LabelFont = "SmallHUD"; }
public MonopolyMenu() { this.Width = fWidth; this.Height = fHeight; this.Center = new Vector2(50f, 30f); this.Texture = "MonopolyMenu"; for (int x = 0; x < oCards.Count(); x++) { oCards[x] = new List <XNACS1Rectangle>(); oCardDisplacements[x] = new List <Vector2>(); } for (int x = 0; x < oButtons1.Count(); x++) // bottom buttons { oButtonDisplacements1[x] = new Vector2(-7.41f + 15f * x, -9.011f); oButtons1[x] = new XNACS1Rectangle(new Vector2(), Global.PixelSize(111), Global.PixelSize(34)); oButtons1[x].UseSpriteSheet = true; oButtons1[x].SetTextureSpriteSheet("TradeMenuButtons1", 3, 1, 0); oButtons1[x].SetTextureSpriteAnimationFrames(x, 0, x, 0, 1, SpriteSheetAnimationMode.AnimateForward); oButtons1[x].LabelColor = Color.White; } oButtons1[0].Label = "Accept"; oButtons1[1].Label = "Cancel"; oButtons1[0].TextureTintColor = oUnavailableColor; for (int x = 0; x < oButtons2.Count(); x++) // resource buttons { oButtonDisplacements2[x] = new Vector2(-18f + Global.PixelSize(37) * x, 4.91f); oButtons2[x] = new XNACS1Rectangle(new Vector2(), Global.PixelSize(33), Global.PixelSize(33)); oButtons2[x].UseSpriteSheet = true; oButtons2[x].SetTextureSpriteSheet("TradeMenuButtons2", 5, 1, 0); oButtons2[x].SetTextureSpriteAnimationFrames(x, 0, x, 0, 1, SpriteSheetAnimationMode.AnimateForward); } }
public void PositionPorts() { int nPosition = -1; int nPortType = -1; // look for port for (int x = 0; x < oIntersections.Count(); x++) { if (oIntersections[x].nPortType == -1) { continue; } if (x == 5) { if (oIntersections[5].nPortType > -1 && oIntersections[0].nPortType > -1) { nPosition = 5; nPortType = oIntersections[x].nPortType; } } else { if (oIntersections[x].nPortType > -1 && oIntersections[x + 1].nPortType > -1) { nPosition = x; nPortType = oIntersections[x].nPortType; } } } // port found if (nPosition > -1) { //oPort = new XNACS1Rectangle(oPortDisplacements[nPosition] + this.Center, Global.PixelSize(72), Global.PixelSize(72)); oPort = new XNACS1Rectangle(this.Center + oPortDisplacement, Global.PixelSize(190), Global.PixelSize(170)); //oPort.Label = "" + nPortType; oPort.UseSpriteSheet = true; oPort.SetTextureSpriteSheet("Ports2", 6, 1, 0); oPort.SetTextureSpriteAnimationFrames(nPosition, 0, nPosition, 0, 1, SpriteSheetAnimationMode.AnimateForward); oPort.Visible = true; oPortSymbol = new XNACS1Rectangle(this.Center + oPortSymbolDisplacements[nPosition], fPortSymbolWidth, fPortSymbolHeight); oPortSymbol.UseSpriteSheet = true; oPortSymbol.SetTextureSpriteSheet("PortSymbols", 6, 1, 0); oPortSymbol.SetTextureSpriteAnimationFrames(nPortType, 0, nPortType, 0, 1, SpriteSheetAnimationMode.AnimateForward); oPortSymbol.Visible = true; } }
public void Recenter(Vector2 oCenter) { this.Center = oCenter + oDisplacement; oBoxes[20].Center = new Vector2(this.CenterX - 29.7f, this.CenterY); oBoxes[21].Center = new Vector2(this.CenterX - 34.0f, this.CenterY); oBoxes[0].Center = new Vector2(this.CenterX - 25.5f, this.CenterY); for (int x = 1; x < oBoxes.Count() - 2; x++) { oBoxes[x].CenterX = oBoxes[x - 1].CenterX + Global.PixelSize(28); oBoxes[x].CenterY = oBoxes[x - 1].CenterY; if ((x) % 5 == 0) { oBoxes[x].CenterX += 1.95f; } } }
public RoadBuildingMenu() { this.Width = fWidth; this.Height = fHeight; this.Center = new Vector2(50f, 30f); this.Texture = "RoadBuildingMenu"; for (int x = 0; x < oButtons.Count(); x++) { oButtonDisplacements[x] = new Vector2(-7.4f + 15f * x, -2.11f); oButtons[x] = new XNACS1Rectangle(new Vector2(), Global.PixelSize(111), Global.PixelSize(34)); oButtons[x].UseSpriteSheet = true; oButtons[x].SetTextureSpriteSheet("TradeMenuButtons1", 3, 1, 0); oButtons[x].SetTextureSpriteAnimationFrames(x, 0, x, 0, 1, SpriteSheetAnimationMode.AnimateForward); oButtons[x].LabelColor = Color.White; } oButtons[0].Label = "Accept"; oButtons[1].Label = "Cancel"; }
public TradeMenu() { this.Width = fWidth; this.Height = fHeight; this.Center = new Vector2(50f, 30f); this.Texture = "TradeMenu"; for (int x = 0; x < oCards1.Count(); x++) { oCards1[x] = new List <XNACS1Rectangle>(); oCardDisplacements1[x] = new List <Vector2>(); oCards2[x] = new List <XNACS1Rectangle>(); oCardDisplacements2[x] = new List <Vector2>(); } for (int x = 0; x < oButtons1.Count(); x++) { oButtonDisplacements1[x] = new Vector2(-14f + 14f * x, -4.1f); oButtons1[x] = new XNACS1Rectangle(new Vector2(), Global.PixelSize(111), Global.PixelSize(34)); oButtons1[x].UseSpriteSheet = true; oButtons1[x].SetTextureSpriteSheet("TradeMenuButtons1", 3, 1, 0); oButtons1[x].SetTextureSpriteAnimationFrames(x, 0, x, 0, 1, SpriteSheetAnimationMode.AnimateForward); oButtons1[x].LabelColor = Color.White; } oButtons1[0].Label = "Trade"; oButtons1[1].Label = "Cancel"; oButtons1[2].Label = "Bank"; for (int x = 0; x < oButtons2.Count(); x++) { oButtonDisplacements2[x] = new Vector2(-18f + Global.PixelSize(37) * x, 10.3f); oButtons2[x] = new XNACS1Rectangle(new Vector2(), Global.PixelSize(33), Global.PixelSize(33)); oButtons2[x].UseSpriteSheet = true; oButtons2[x].SetTextureSpriteSheet("TradeMenuButtons2", 5, 1, 0); oButtons2[x].SetTextureSpriteAnimationFrames(x, 0, x, 0, 1, SpriteSheetAnimationMode.AnimateForward); } }
public void Create(Stats oStats, Camera oCamera) { this.Width = Global.PixelSize(824); this.Height = Global.PixelSize(472); this.Texture = "TurnStatsMenu3"; this.Center = oDisplacement; oMenuName = new XNACS1Rectangle(); oMenuName.Color = new Color(0, 0, 0, 0); oMenuName.LabelFont = "SmallHUD"; oMenuName.Label = "Resources Graphs"; oMenuName.LabelColor = Color.White; oButtons = new XNACS1Rectangle[nButtonCount]; oButtonDisplacements = new Vector2[nButtonCount]; for (int x = 0; x < oButtons.Count(); x++) { oButtons[x] = new XNACS1Rectangle(new Vector2(), fButtonWidth, fButtonHeight, "StatsMenuButton"); oButtons[x].Label = "" + (x + 1); oButtons[x].LabelFont = "SmallHUD"; oButtons[x].LabelColor = Color.White; oButtons[x].TextureTintColor = oUnselectedColor; oButtonDisplacements[x] = new Vector2(-36.35f + 3f * x, 19f); } oButtons[1].TextureTintColor = oOriginalColor; //oQuitButton = new XNACS1Rectangle(this.Center + oQuitButtonOffest, Global.PixelSize(37), Global.PixelSize(37), "CloseButton"); //oQuitButton.Color = Color.Red; oRollsGraph = new Graph(new Vector2(-16f, -1.6f), new Vector2(Global.PixelSize(428), Global.PixelSize(362)), 11, oStats.nRollCounts, "Rolls Made", new string[] { "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }, "GraphBox1"); oRollsGraph.Recenter(this); oResourcesGraph = new Graph(new Vector2(21.6f, -1.6f), new Vector2(Global.PixelSize(314), Global.PixelSize(362)), 5, oStats.nResourceCounts, "Resources Gained", new string[] { "Wood", "Lumber", "Ore", "Grain", "Brick" }, "GraphBox1"); oResourcesGraph.Recenter(this); Recenter(oCamera); }
public HUD(Stats oStats) { this.Width = fWidth; this.Height = fHeight; this.Color = Color.Purple; this.Texture = "MainHUD"; //this.Visible = false; oTurnNumber = new XNACS1Rectangle(); oTurnNumber.Label = oStats.nCurrentTurn + ""; oTurnNumber.Center = oTurnNumberDisplacement; oTurnNumber.Color = new Color(0, 0, 0, 0); // make box invisible oTurnNumber.LabelFont = "SmallHUD"; oTurnNumber.LabelColor = Color.White; oCurrentPlayer = new XNACS1Rectangle(); oCurrentPlayer.Label = oStats.oPlayers[oStats.nCurrentPlayer].sName; oCurrentPlayer.Center = oCurrentPlayerDisplacement; oCurrentPlayer.LabelFont = "SmallHUD"; oCurrentPlayer.LabelColor = Color.White; oCurrentPlayer.Color = new Color(0, 0, 0, 0); // make box invisible oDiceDisplacement[0] = new Vector2(87.31f, 62.91f); oDiceDisplacement[1] = new Vector2(94.31f, 62.91f); oDice[0] = new XNACS1Rectangle(oDiceDisplacement[0], fDiceWidth, fDiceHeight); oDice[0].SetTextureSpriteSheet("dice", 7, 2, 0); oDice[0].UseSpriteSheet = true; oDice[0].SetTextureSpriteAnimationFrames(0, 0, 0, 0, 1, SpriteSheetAnimationMode.AnimateForward); oDice[1] = new XNACS1Rectangle(oDiceDisplacement[1], fDiceWidth, fDiceHeight); oDice[1].SetTextureSpriteSheet("dice", 7, 2, 0); oDice[1].UseSpriteSheet = true; oDice[1].SetTextureSpriteAnimationFrames(0, 1, 0, 1, 1, SpriteSheetAnimationMode.AnimateForward); for (int x = 0; x < oSmallHUDs.Count(); x++) { oSmallHUDs[x] = new SmallHUD(new Vector2(12.51f + 23.01f * x, 64f), x + 1); oSmallHUDs[x].SetName(oStats.oPlayers[x].sName); } for (int x = 0; x < oCards.Count(); x++) { oCards[x] = new List <XNACS1Rectangle>(); oCardDisplacements[x] = new List <Vector2>(); } oButtonDisplacement[0] = new Vector2(55.5f, 14.01f); oButtonDisplacement[1] = new Vector2(61.5f, 14.01f); oButtonDisplacement[2] = new Vector2(67.5f, 14.01f); oButtonDisplacement[3] = new Vector2(73.5f, 14.01f); oButtonDisplacement[4] = new Vector2(84.01f, 14.01f); oButtonDisplacement[5] = new Vector2(90.01f, 14.01f); oButtonDisplacement[6] = new Vector2(96.01f, 14.01f); oButtons[0] = new XNACS1Rectangle(oButtonDisplacement[2], Global.PixelSize(55), Global.PixelSize(55), "RoadButton"); oButtons[1] = new XNACS1Rectangle(oButtonDisplacement[0], Global.PixelSize(55), Global.PixelSize(55), "SettlementButton"); oButtons[2] = new XNACS1Rectangle(oButtonDisplacement[1], Global.PixelSize(55), Global.PixelSize(55), "CityButton"); oButtons[3] = new XNACS1Rectangle(oButtonDisplacement[3], Global.PixelSize(55), Global.PixelSize(55), "DevelopmentCardButton"); oButtons[4] = new XNACS1Rectangle(oButtonDisplacement[4], Global.PixelSize(55), Global.PixelSize(55), "DiceButton"); oButtons[5] = new XNACS1Rectangle(oButtonDisplacement[5], Global.PixelSize(55), Global.PixelSize(55), "TradeButton"); oButtons[6] = new XNACS1Rectangle(oButtonDisplacement[6], Global.PixelSize(55), Global.PixelSize(55), "EndTurnButton"); //test //for (int x = 0; x < 4; x++) //{ // oButtons[x].Visible = false; //} }
public TurnRecordBar(int[] nValues, Vector2 oNewDisplacement) { this.LabelColor = Color.White; this.LabelFont = "TurnMenu"; this.Texture = "Empty"; oDisplacement = oNewDisplacement; // create boxes for (int x = 0; x < oBoxes.Count(); x++) { oBoxes[x] = new XNACS1Rectangle(new Vector2(), Global.PixelSize(27), Global.PixelSize(27), "TurnRecordBox"); oBoxes[x].LabelFont = "TurnMenu"; } // record appearance for empty record for (int x = 0; x < oBoxes.Count(); x++) { if (nValues == null) { oBoxes[x].Label = "-"; this.Label = " "; this.Label = "- -"; this.Label = " "; } else { oBoxes[x].Label = "" + nValues[x]; } } // make each box correct color for (int x = 0; x < 4; x++) { for (int y = 0; y < 5; y++) { oBoxes[y + x * 5].LabelColor = Color.Black; if (y == 0) { oBoxes[y + x * 5].TextureTintColor = oWoolColor; } else if (y == 1) { oBoxes[y + x * 5].TextureTintColor = oLumberColor; } else if (y == 2) { oBoxes[y + x * 5].TextureTintColor = oOreColor; } else if (y == 3) { oBoxes[y + x * 5].TextureTintColor = oGrainColor; } else if (y == 4) { oBoxes[y + x * 5].TextureTintColor = oBrickColor; } if (nValues == null || nValues[y + x * 5] == 0) { oBoxes[y + x * 5].TextureTintColor = oNoneColor; oBoxes[y + x * 5].LabelColor = Color.Black; } } } oBoxes[20].TextureTintColor = oNoneColor; oBoxes[21].TextureTintColor = oNoneColor; // assign correct color to boxes }
public Hex(Vector2 oCenter, int nNumber, string sType, string sLabel = null) { this.Center = oCenter + new Vector2(0f, 10f); this.nNumber = nNumber; this.Width = fWidth; this.Height = fHeight; this.sType = sType; otest = new XNACS1Rectangle(this.Center, 3f, 2f); otest.Color = new Color(0, 0, 0, 170); otest.LabelFont = "SmallHUD"; otest.LabelColor = Color.Red; otest.Visible = false; oNumber = new XNACS1Rectangle(this.Center + oNumberOffset, Global.PixelSize(28), Global.PixelSize(25)); oNumber.SetTextureSpriteSheet("ResourceNumbers2", 11, 1, 0); oNumber.UseSpriteSheet = true; oNumber.SetTextureSpriteAnimationFrames(nNumber - 2, 0, nNumber - 2, 0, 1, SpriteSheetAnimationMode.AnimateForward); oPortDisplacements[0] = new Vector2(0f, 5.0f); oPortDisplacements[1] = new Vector2(-6.1f, 3.45f); oPortDisplacements[2] = new Vector2(-6.1f, -3.45f); oPortDisplacements[3] = new Vector2(0f, -6.2f); oPortDisplacements[4] = new Vector2(6.1f, -3.45f); oPortDisplacements[5] = new Vector2(6.1f, 3.45f); oPortSymbolDisplacements[0] = new Vector2(0f, 10f); oPortSymbolDisplacements[1] = new Vector2(-10f, 5f); oPortSymbolDisplacements[2] = new Vector2(-10f, -5f); oPortSymbolDisplacements[3] = new Vector2(0f, -10f); oPortSymbolDisplacements[4] = new Vector2(10f, -5f); oPortSymbolDisplacements[5] = new Vector2(10f, 5f); switch (sType) { case "wool": this.Texture = "WoolHex2"; break; case "lumber": this.Texture = "LumberHex2"; break; case "ore": this.Texture = "OreHex2"; break; case "grain": this.Texture = "GrainHex2"; break; case "brick": this.Texture = "BrickHex2"; break; case "empty": this.Texture = "OreHex2"; this.TextureTintColor = new Color(0, 0, 0, 256); break; } }
public StatisticsMenu1(Stats oStats, Camera oCamera) { this.Width = Global.PixelSize(824); this.Height = Global.PixelSize(472); this.Texture = "TurnStatsMenu2"; this.Center = oDisplacement; oColumnNames = new XNACS1Rectangle(); oColumnNames.Color = new Color(0, 0, 0, 0); oColumnNames.LabelFont = "SmallHUD"; oColumnNames.Label = " Turn Roll"; oColumnNames.LabelColor = Color.Brown; oMenuName = new XNACS1Rectangle(); oMenuName.Color = new Color(0, 0, 0, 0); oMenuName.LabelFont = "SmallHUD"; oMenuName.Label = "Resources Gained Per Turn"; oMenuName.LabelColor = Color.White; oButtons = new XNACS1Rectangle[nButtonCount]; oButtonDisplacements = new Vector2[nButtonCount]; for (int x = 0; x < oButtons.Count(); x++) { oButtons[x] = new XNACS1Rectangle(new Vector2(), fButtonWidth, fButtonHeight, "StatsMenuButton"); oButtons[x].Label = "" + (x + 1); oButtons[x].LabelFont = "SmallHUD"; oButtons[x].LabelColor = Color.White; oButtons[x].TextureTintColor = oUnselectedColor; oButtonDisplacements[x] = new Vector2(-36.35f + 3f * x, 19f); } oButtons[0].TextureTintColor = oOriginalColor; for (int x = 0; x < oStats.oPlayers.Count(); x++) { oPlayerNames[x] = new XNACS1Rectangle(); oPlayerNames[x].LabelFont = "SmallHUD"; oPlayerNames[x].Color = new Color(0, 0, 0, 0); oPlayerNames[x].Label = oStats.oPlayers[x].sName; oPlayerNames[x].LabelColor = Color.Brown; oPlayerNamesDisplacements[x] = new Vector2(-19.5f + 15.9f * x, 16f); } #region Test Data //Random oRandom = new Random(); //int[] oNewRecord; //for (int x = 0; x < nMaxRecords - 1; x++) //{ // oNewRecord = new int[22]; // for (int y = 0; y < oNewRecord.Count(); y++) // { // oNewRecord[y] = oRandom.Next(20); // } // AddRecord(oNewRecord); //} #endregion CreateRecords(oStats.nTurnResourceRecords); Recenter(oCamera); }
public StatisticsMenu3(Stats oStats, Camera oCamera) { this.Width = Global.PixelSize(824); this.Height = Global.PixelSize(472); this.Texture = "TurnStatsMenu2"; this.Center = oDisplacement; //this.LabelColor = Color.Red; //this.Label += "Total Gained:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesGained[x]; //this.Label += "\nTotal Lost:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; //this.Label += "\n Gained Through Trading:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; //this.Label += "\n Lost Through Trading:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; //this.Label += "\n Robbers Used:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; //this.Label += "\n Times Robbed:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; //this.Label += "\n Gained From Advancement Cards:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; //this.Label += "\n Lost From Advancement Cards:"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; //this.Label += "\n Lost From Blocking"; //for (int x = 0; x < 4; x++) // this.Label += " " + oStats.nTotalResourcesLost[x]; oMenuName = new XNACS1Rectangle(); oMenuName.Color = new Color(0, 0, 0, 0); oMenuName.LabelFont = "SmallHUD"; oMenuName.Label = "Player Statistics"; oMenuName.LabelColor = Color.White; oButtons = new XNACS1Rectangle[nButtonCount]; oButtonDisplacements = new Vector2[nButtonCount]; for (int x = 0; x < oButtons.Count(); x++) { oButtons[x] = new XNACS1Rectangle(new Vector2(), fButtonWidth, fButtonHeight, "StatsMenuButton"); oButtons[x].Label = "" + (x + 1); oButtons[x].LabelFont = "SmallHUD"; oButtons[x].LabelColor = Color.White; oButtons[x].TextureTintColor = oUnselectedColor; oButtonDisplacements[x] = new Vector2(-36.35f + 3f * x, 19f); } oButtons[2].TextureTintColor = oOriginalColor; for (int x = 0; x < oStats.oPlayers.Count(); x++) { oPlayerNames[x] = new XNACS1Rectangle(); oPlayerNames[x].LabelFont = "SmallHUD"; oPlayerNames[x].Color = new Color(0, 0, 0, 0); oPlayerNames[x].Label = oStats.oPlayers[x].sName; oPlayerNames[x].LabelColor = Color.White; oPlayerNamesDisplacements[x] = new Vector2(-19.5f + 15.9f * x, 16f); } Recenter(oCamera); }