public void RenderRank(Sprite sprite) { List <Player> players = new List <Player>(); for (int i = 0; i < gameLogic.LocalPlayerCount; i++) { players.Add(gameLogic.GetLocalPlayer(i)); } RankInfo.StatisticRank(players); int startX = 543; int startY = 160; for (int i = 0; i < players.Count; i++) { if (players[i].Type != PlayerType.LocalHuman) { string s = (i + 1).ToString(); sprite.Draw(rankBackground, startX, startY, ColorValue.White); f8.DrawString(sprite, s, startX, startY - 20, ColorValue.White); Matrix trans = Matrix.Scaling(0.33f, 0.33f, 1) * Matrix.Translation(new Vector3(startX + 19, startY + 14, 0)); sprite.SetTransform(trans); f8.DrawString(sprite, "TH", 0, 0, ColorValue.White); sprite.SetTransform(Matrix.Identity); sprite.Draw(rankColor, startX + 35, startY + 9, players[i].SideColor); f8.DrawString(sprite, players[i].Area.CityCount.ToString(), startX + 80, startY - 20, ColorValue.White); startY += 37; } else { string s = (i + 1).ToString(); sprite.Draw(homeBackground, startX, startY - 4, players[i].SideColor); f8.DrawString(sprite, s, startX + 2, startY, ColorValue.White); Matrix trans = Matrix.Scaling(0.35f, 0.35f, 1) * Matrix.Translation(new Vector3(startX + 22, startY + 35, 0)); sprite.SetTransform(trans); f8.DrawString(sprite, "TH", 0, 0, ColorValue.White); sprite.SetTransform(Matrix.Identity); f6.DrawString(sprite, players[i].Area.CityCount.ToString(), startX + 73, startY - 45, ColorValue.White); startY += 70; } } }
public InGameUI(Code2015 game, Game parent, GameScene scene, GameState gamelogic) { this.parent = parent; this.logic = gamelogic; this.game = game; this.renderSys = game.RenderSystem; this.scene = scene; this.player = parent.HumanPlayer; picker = new Picker(game, parent, scene, gamelogic); AddElement(picker); //this.infoUI = new InfoUI(game, parent, scene, gamelogic); //AddElement(infoUI); this.miniMap = new MiniMap(game, parent, scene, gamelogic); AddElement(miniMap); //-----Ruan----------- cityStatusInfo = new CitySelectInfo(game, parent, scene, gamelogic); AddElement(cityStatusInfo); objectStatusInfo = new ObjectSelectInfo(game, parent, scene, gamelogic); AddElement(objectStatusInfo); sendBallSelect = new RBallTypeSelect(game, parent, scene, gamelogic); AddElement(sendBallSelect); nigMenu = new NIGMenu(game, parent, scene, gamelogic); AddElement(nigMenu); nigColor = new NIGColor(game, parent, scene, gamelogic); AddElement(nigColor); nigWin = new NIGWin(game, parent, scene, gamelogic); AddElement(nigWin); nigFail = new NIGFail(game, parent, scene, gamelogic); AddElement(nigFail); nigObjective = new NIGObjective(game, parent, scene, gamelogic); AddElement(nigObjective); nigColor = new NIGColor(game, parent, scene, gamelogic); AddElement(nigColor); rankInfo = new RankInfo(game, parent, scene, gamelogic); AddElement(rankInfo); selectionMarker = new SelectionMarker(renderSys, gamelogic.Field, player); scene.Scene.AddObjectToScene(selectionMarker); layeredCursor = new Cursor(game, parent, scene, gamelogic, picker, cityStatusInfo, objectStatusInfo, sendBallSelect, miniMap, selectionMarker, rankInfo); AddElement(layeredCursor); exit = new ExitGame(game, parent, scene, gamelogic, nigMenu); AddElement(exit); quest = new Quest(game, parent, scene, gamelogic); AddElement(quest); }
public Cursor(Code2015 game, Game parent, GameScene scene, GameState gamelogic, Picker picker, CitySelectInfo citySelectInfo, ObjectSelectInfo objSelectInfo, RBallTypeSelect sendBallSelect, MiniMap map, SelectionMarker marker, RankInfo rankInfo) { this.parent = parent; this.logic = gamelogic; this.player = gamelogic.LocalHumanPlayer; this.rankInfo = rankInfo; this.game = game; this.renderSys = game.RenderSystem; this.scene = scene; this.picker = picker; this.selectionMarker = marker; this.citySelectInfo = citySelectInfo; this.objSelectInfo = objSelectInfo; this.sendBallSelect = sendBallSelect; this.miniMap = map; FileLocation fl = FileSystem.Instance.Locate("cursor.tex", GameFileLocs.GUI); cursor = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_u.tex", GameFileLocs.GUI); cursor_up = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_l.tex", GameFileLocs.GUI); cursor_left = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_d.tex", GameFileLocs.GUI); cursor_down = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_r.tex", GameFileLocs.GUI); cursor_right = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_lu.tex", GameFileLocs.GUI); cursor_ul = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_ru.tex", GameFileLocs.GUI); cursor_ur = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_ld.tex", GameFileLocs.GUI); cursor_dl = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_rd.tex", GameFileLocs.GUI); cursor_dr = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_move.tex", GameFileLocs.GUI); cursor_move = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_stop.tex", GameFileLocs.GUI); cursor_stop = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_toofar.tex", GameFileLocs.GUI); cursor_toofar = UITextureManager.Instance.CreateInstance(fl); cursor_sel = new Texture[11]; for (int i = 0; i < cursor_sel.Length; i++) { fl = FileSystem.Instance.Locate("selcursor" + (i + 13).ToString("D2") + ".tex", GameFileLocs.GUI); cursor_sel[i] = UITextureManager.Instance.CreateInstance(fl); } cursor_attack = new Texture[11]; for (int i = 0; i < cursor_attack.Length; i++) { fl = FileSystem.Instance.Locate("selcursor" + (i + 1).ToString("D2") + ".tex", GameFileLocs.GUI); cursor_attack[i] = UITextureManager.Instance.CreateInstance(fl); } cursorState = MouseCursor.Normal; }