public override void enterState() { new Background("bgs/bgtile", 0, 0); RenderingEngine.camera.setScale(Constants.GAMESCALE * (Constants.DEBUG ? 1366f / 1920f : 1)); RenderingEngine.camera.setPosition(new Vector2(1920 / 2, 1080 / 2)); RenderingEngine.ambientLight = Color.Gray; RenderingEngine.UI.addText(ai_data = new HUDText("AI Level", new Vector2(1250, 20), customfont, Color.White)); RenderingEngine.UI.addText(time = new HUDText("Timer", new Vector2(50, 20), customfont, Color.White)); timer = Constants.TIMEINTRO + Constants.TIMEMILLIS; map = new Map(mapname, content); players = new Player[4]; scores = new HUDText[4]; large = new HUDText("Starting", new Vector2(880, 500), customfont2, Color.White); RenderingEngine.UI.addText(large); toggles = new bool[4]; this.spawns = map.spawns; for (int i = 0; i < 4; i++) { players[i] = new Player(map.spawns, i + 1, this); scores[i] = new HUDText("0", new Vector2(500 + i * 140, 20), customfont, (i == 0 ? Color.Red : (i == 1 ? Color.Yellow : (i == 2 ? Color.LightGreen : Color.Blue)))); RenderingEngine.UI.addText(scores[i]); toggles[i] = false; } //SoundManager.PlayMusicLooped("sound/4614(2)"); fs = File.Open("dw_kb_" + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + ".txt", FileMode.OpenOrCreate, FileAccess.Write); writeString(mapname); }
public override void enterState() { title = new HUDText("Press 'A' to replay!", new Vector2(50, 50), customfont, Color.White); title2 = new HUDText("Press 'B' to select a different map!", new Vector2(50, 100), customfont, Color.White); RenderingEngine.UI.addText(title); RenderingEngine.UI.addText(title2); bg = new UniformBackground("bgs/dw", 0, 0); RenderingEngine.camera.setScale(Constants.DEBUG? 1366f / 1920f : 1); RenderingEngine.ambientLight = Color.White; RenderingEngine.camera.setPosition(Vector2.Zero); timer = Constants.TIMEREPLAY; }
public override void enterState() { int ndx = 0; title = new HUDText("Select a map to play!", new Vector2(50, 50), customfont, Color.White); RenderingEngine.UI.addText(title); maps = new List<HUDText>(); foreach (String s in Constants.mapnames) { maps.Add(new HUDText(s, new Vector2(100, 150 + 100 * ndx), customfont, Color.Gray)); RenderingEngine.UI.addText(maps[ndx++]); } maps[0].setColor(Color.LightGray); bg = new UniformBackground("bgs/dw", 0, 0); RenderingEngine.camera.setScale(Constants.DEBUG? 1366f / 1920f : 1); RenderingEngine.ambientLight = Color.White; RenderingEngine.camera.setPosition(Vector2.Zero); }
/// <summary> /// Adds a HUDtext to the user interface /// </summary> /// <param name="text">The text to add</param> public void addText(HUDText text) { this.text.Add(text); }
/// <summary> /// Removes a HUDtext from the user interface /// </summary> /// <param name="text">The text to remove</param> public void removeText(HUDText text) { this.text.Remove(text); }