public TextField(Vector2 a_position, int a_width, int a_height, bool a_acceptLetters, bool a_acceptNumbers, bool a_acceptSpecials, int a_maxLength) : base(a_position, "") { m_textToShow = new Text(a_position, new Vector2(4, 2), "", "VerdanaBold", Color.Black, false); m_box = new Box(a_position, a_width, a_height, Color.White, Color.Black, 2, false); m_caret = new Line(m_box.getPosition(), m_box.getPosition(), new Vector2(5, 3), new Vector2(5, a_height - 3), Color.Black, 1, true); m_writing = false; m_acceptLetters = a_acceptLetters; m_acceptNumbers = a_acceptNumbers; m_acceptSpecials = a_acceptSpecials; m_maxLength = a_maxLength; m_currentLocale = "euSv"; m_posV2 = a_position; }
public override void load() { base.load(); Game.getInstance().m_camera.setPosition(Vector2.Zero); Vector2 t_textOffset = new Vector2(5, 2); m_triggerButtons = new LinkedList<Button>(); m_effectButtons = new LinkedList<Button>(); m_triggerMenu = new LinkedList<TextButton>(); m_effectMenu = new LinkedList<TextButton>(); m_recLines = new Line[4]; m_textField = null; m_background = new Box(Vector2.Zero, 400, Game.getInstance().getResolution().Y, Color.Gray, false); m_btnAddEvent = new Button("btn_asset_list", new Vector2(0, (m_events.Keys.Count * 25)), "Add Event", "VerdanaBold", Color.Black, t_textOffset); m_btnAddEvent.m_clickEvent += new Button.clickDelegate(newEvent); m_btnAddTrigger = new Button("btn_asset_list", Vector2.Zero, "Add Trigger", "VerdanaBold", Color.Black, t_textOffset); m_btnAddTrigger.m_clickEvent += new Button.clickDelegate(newTrigger); m_btnAddEffect = new Button("btn_asset_list", Vector2.Zero, "Add Effect", "VerdanaBold", Color.Black, t_textOffset); m_btnAddEffect.m_clickEvent += new Button.clickDelegate(newEffect); m_triggerMenu.AddLast(new TextButton(new Vector2(400, 555), "Rectangle", "MotorwerkNormal")); m_triggerMenu.Last().m_clickEvent += new TextButton.clickDelegate(addRectangle); m_triggerMenu.AddLast(new TextButton(new Vector2(400, 580), "Circle (NYI)", "MotorwerkNormal")); m_triggerMenu.Last().m_clickEvent += new TextButton.clickDelegate(addCircle); m_triggerMenu.AddLast(new TextButton(new Vector2(400, 605), "Switch/Button", "MotorwerkNormal")); m_triggerMenu.Last().m_clickEvent += new TextButton.clickDelegate(addSwitch); m_triggerMenu.AddLast(new TextButton(new Vector2(400, 630), "Chase check", "MotorwerkNormal")); m_triggerMenu.Last().m_clickEvent += new TextButton.clickDelegate(addChase); m_triggerMenu.AddLast(new TextButton(new Vector2(400, 655), "IsDeadTrigger", "MotorwerkNormal")); m_triggerMenu.Last().m_clickEvent += new TextButton.clickDelegate(addIsDead); m_effectMenu.AddLast(new TextButton(new Vector2(400, 580), "Cutscene", "MotorwerkNormal")); m_effectMenu.Last().m_clickEvent += new TextButton.clickDelegate(addCutscene); m_effectMenu.AddLast(new TextButton(new Vector2(400, 605), "Equip", "MotorwerkNormal")); m_effectMenu.Last().m_clickEvent += new TextButton.clickDelegate(addEquip); m_effectMenu.AddLast(new TextButton(new Vector2(400, 630), "Door", "MotorwerkNormal")); m_effectMenu.Last().m_clickEvent += new TextButton.clickDelegate(addDoorEffect); m_deleteEvent = new Button("DevelopmentHotkeys//btn_delete_hotkey", new Vector2(250, 0)); m_deleteEvent.m_clickEvent += new Button.clickDelegate(deleteEvent); m_exitEvent = new TextButton(new Vector2(20, Game.getInstance().getResolution().Y - 100), "Exit", "MotorwerkLarge"); ((TextButton)m_exitEvent).m_clickEvent += new TextButton.clickDelegate(exitState); m_deleteTriggerEffect = new Button("btn_small_delete", Vector2.Zero); m_deleteTriggerEffect.m_clickEvent += new Button.clickDelegate(deleteTriggerEffect); }
public override void load() { if (File.Exists("Content\\levels\\" + m_levelToLoad)) { Level t_loadedLevel = Loader.getInstance().loadLevel(m_levelToLoad); m_gameObjectList = t_loadedLevel.getGameObjects(); m_events = t_loadedLevel.getEvents(); } else { m_events = new LinkedList<Event>(); for (int i = 0; i < m_gameObjectList.Length; ++i) { m_gameObjectList[i] = new LinkedList<GameObject>(); } } foreach (LinkedList<GameObject> t_ll in m_gameObjectList) { for (int i = 0; i < t_ll.Count(); i++) { t_ll.ElementAt(i).loadContent(); if (t_ll.ElementAt(i) is Player) { m_player = t_ll.ElementAt(i); Game.getInstance().m_camera.setPosition(m_player.getPosition().getGlobalCartesian()); } } } foreach (Event t_e in m_events) { t_e.loadContent(); } m_buttonDict = new Dictionary<Button, State>(); m_assetButtonList = new LinkedList<Button>(); m_lineList = new LinkedList<Line>(); m_objectPreview = null; m_guiList.AddLast(m_layerLabel = new Text(new Vector2(350, 3) , "", "VerdanaBold", Color.Black, false)); m_guiList.AddLast(m_parallaxLabel = new Text(new Vector2(460, 3) , "Parallax Value:", "VerdanaBold", Color.Black, false)); m_guiList.AddLast(m_textObjectInfo = new Text(new Vector2(10, 3) , "", "VerdanaBold", Color.Black, false)); m_guiList.AddLast(m_textGuardInfo = new Text(new Vector2(480, 3) , "", "VerdanaBold", Color.Black, false)); m_layerTextField = new TextField(new Vector2(400, 0), 50, 25, false, true, false, 3); m_parallaxScrollTF = new TextField(new Vector2(580, 0), 70, 25, false, true, false, 3); m_statusBar = new Box(new Vector2(0, 0), (int)Game.getInstance().getResolution().X, 25, Color.LightGray, false); m_statusBar.setLayer(0.111f); Vector2 t_btnTextOffset = new Vector2(21, 17); Vector2 t_modV2 = new Vector2(15, 0); Button t_button; //----------------------------------- #region Buttons that are always shown m_buttonDict.Add(m_btnSelect = new Button("DevelopmentHotkeys//btn_select_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "S", "VerdanaBold", Color.Black, t_btnTextOffset), State.None); m_btnSelect.setHotkey(new Keys[] { Keys.S }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_delete_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "D", "VerdanaBold", Color.Black, t_btnTextOffset), State.Delete); t_button.setHotkey(new Keys[] { Keys.D }, guiButtonClick); #endregion //----------------------------------- //----------------------------------- #region Building mode buttons m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_ladder_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "L", "VerdanaBold", Color.Black, t_btnTextOffset), State.Ladder); t_button.setHotkey(new Keys[] { Keys.L }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_platform_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "P", "VerdanaBold", Color.Black, t_btnTextOffset), State.Platform); t_button.setHotkey(new Keys[] { Keys.P }, guiButtonClick); m_buttonDict.Add(m_btnBackground = new Button("DevelopmentHotkeys//btn_background_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "B", "VerdanaBold", Color.Black, t_btnTextOffset), State.Background); m_btnBackground.setHotkey(new Keys[] { Keys.B }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_hero_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "H", "VerdanaBold", Color.Black, t_btnTextOffset), State.Player); t_button.setHotkey(new Keys[] { Keys.H }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_spotlight_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "T", "VerdanaBold", Color.Black, t_btnTextOffset), State.SpotLight); t_button.setHotkey(new Keys[] { Keys.T }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_wall_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "W", "VerdanaBold", Color.Black, t_btnTextOffset), State.Wall); t_button.setHotkey(new Keys[] { Keys.W }, guiButtonClick); m_buttonDict.Add(t_button= new Button("DevelopmentHotkeys//btn_lightswitch_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "s+T", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.LightSwitch); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.T }, guiButtonClick); m_buttonDict.Add(m_btnVent = new Button("DevelopmentHotkeys//btn_ventilation_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "V", "VerdanaBold", Color.Black, t_btnTextOffset), State.Ventrance); m_btnVent.setHotkey(new Keys[] { Keys.V }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_window_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "N", "VerdanaBold", Color.Black, t_btnTextOffset), State.Window); t_button.setHotkey(new Keys[] { Keys.N }, guiButtonClick); m_buttonDict.Add(m_btnGuard = new Button("DevelopmentHotkeys//btn_guard_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "G", "VerdanaBold", Color.Black, t_btnTextOffset), State.Guard); m_btnGuard.setHotkey(new Keys[] { Keys.G }, guiButtonClick); m_buttonDict.Add(m_btnDuckHide = new Button("DevelopmentHotkeys//btn_duckhide_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "A", "VerdanaBold", Color.Black, t_btnTextOffset), State.DuckHidingObject); m_btnDuckHide.setHotkey(new Keys[] { Keys.A }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_foreground_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "F", "VerdanaBold", Color.Black, t_btnTextOffset), State.Foreground); t_button.setHotkey(new Keys[] { Keys.F }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_rope_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "O", "VerdanaBold", Color.Black, t_btnTextOffset), State.Rope); t_button.setHotkey(new Keys[] { Keys.O }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_doorhang_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "s+W", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.CornerHang); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.W }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_checkpoint_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "K", "VerdanaBold", Color.Black, t_btnTextOffset), State.Checkpoint); t_button.setHotkey(new Keys[] { Keys.K }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_clutter_hotkey", new Vector2(0, 32 * m_buttonDict.Count() + 25), "C", "VerdanaBold", Color.Black, t_btnTextOffset), State.Prop); t_button.setHotkey(new Keys[] { Keys.C }, guiButtonClick); m_buttonDict.Add(m_btnConsKey = new Button(null, new Vector2(0, 32 * m_buttonDict.Count() + 25), "c+A", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.Consumable); m_btnConsKey.setHotkey(new Keys[] { Keys.LeftControl, Keys.A }, guiButtonClick); m_buttonDict.Add(t_button = new Button(null, new Vector2(0, 32 * m_buttonDict.Count() + 25), "s+D", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.LockedDoor); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.D }, guiButtonClick); m_buttonDict.Add(t_button = new Button(null, new Vector2(0, 32 * m_buttonDict.Count() + 25), "c+F", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.FlickeringSign); t_button.setHotkey(new Keys[] { Keys.LeftControl, Keys.F }, guiButtonClick); #endregion //----------------------------------- //----------------------------------- #region Ventilation buttons Vector2 t_ventMenu = new Vector2(m_btnVent.getBox().X + 32, m_btnVent.getBox().Y); int t_buttonNumber = 0; m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_tvent_hotkey", t_ventMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+V", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.TVent); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.V }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_svent_hotkey", t_ventMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+A", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.StraVent); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.A }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_cvent_hotkey", t_ventMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+C", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.CrossVent); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.C }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_ovent_hotkey", t_ventMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+R", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.CornerVent); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.R }, guiButtonClick); m_buttonDict.Add(t_button = new Button(null, t_ventMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+E", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.EndVent); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.E }, guiButtonClick); #endregion //----------------------------------- //----------------------------------- #region Hiding object buttons t_buttonNumber = 0; Vector2 t_hideMenu = new Vector2(m_btnDuckHide.getBox().X + 32, m_btnDuckHide.getBox().Y); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_standhide_hotkey", t_hideMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+F", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.StandHidingObject); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.F }, guiButtonClick); #endregion //----------------------------------- //----------------------------------- #region Guard object buttons t_buttonNumber = 0; Vector2 t_guardMenu = new Vector2(m_btnGuard.getBox().X + 32, m_btnGuard.getBox().Y); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_dog_hotkey", t_guardMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+G", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.GuardDog); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.G }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_camera_hotkey", t_guardMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+Q", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.Camera); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.Q }, guiButtonClick); #endregion //----------------------------------- //----------------------------------- #region Consumable Buttons t_buttonNumber = 0; Vector2 t_consMenu = new Vector2(m_btnConsKey.getBox().X + 32, m_btnConsKey.getBox().Y); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_key_hotkey", t_consMenu + new Vector2(t_buttonNumber++ * 32, 0), "Z", "VerdanaBold", Color.Black, t_btnTextOffset), State.Key); t_button.setHotkey(new Keys[] { Keys.Z }, guiButtonClick); m_buttonDict.Add(t_button = new Button("DevelopmentHotkeys//btn_heart_hotkey", t_consMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+H", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.Heart); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.H }, guiButtonClick); m_buttonDict.Add(t_button = new Button(null, t_consMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+B", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.Objective); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.B }, guiButtonClick); #endregion //----------------------------------- //----------------------------------- #region Background Buttons t_buttonNumber = 0; Vector2 t_bgMenu = new Vector2(m_btnBackground.getBox().X + 32, m_btnBackground.getBox().Y); m_buttonDict.Add(t_button = new Button(null, t_bgMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+X", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.Shadow); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.X }, guiButtonClick); m_buttonDict.Add(t_button = new Button(null, t_bgMenu + new Vector2(t_buttonNumber++ * 32, 0), "s+Z", "VerdanaBold", Color.Black, t_btnTextOffset - t_modV2), State.Parallax); t_button.setHotkey(new Keys[] { Keys.LeftShift, Keys.Z }, guiButtonClick); #endregion //----------------------------------- //----------------------------------- #region Layer buttons m_buttonList.AddLast(m_layerButtonList = GuiListFactory.createNumeratedList(5, "DevelopmentHotkeys//btn_layer_chooser")); GuiListFactory.setListPosition(m_layerButtonList, new Vector2(40, Game.getInstance().getResolution().Y - (m_layerButtonList.First().getBox().Height))); GuiListFactory.setButtonDistance(m_layerButtonList, new Vector2(73, 0)); GuiListFactory.setTextOffset(m_layerButtonList, new Vector2(34, 8)); int k = 1; foreach (Button t_feButton in m_layerButtonList) { t_feButton.setHotkey(new Keys[] { (Keys)Enum.Parse(typeof(Keys), "D" + k++) }, setLayer); } #endregion //----------------------------------- setBuildingState(m_btnSelect, State.None); base.load(); }
private bool parseAndExecute(GameTime a_gameTime) { char[] t_delimiterChars = {':'}; m_currentCommand = m_commands[m_comDone].Split(t_delimiterChars); if (m_currentCommand[0].Equals("waitForKey", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length == 1) { throw new ParseException(); } m_waiting = true; return false; } else if (m_currentCommand[0].Equals("waitUntil", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length == 1) { throw new ParseException(); } m_timeForNextCommand = (float)a_gameTime.TotalGameTime.TotalMilliseconds + ((float)int.Parse(m_currentCommand[1])); return false; } else if (m_currentCommand[0].Equals("addGUI", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length < 5) { throw new ParseException(); } m_guis.Add(int.Parse(m_currentCommand[1]), new GuiObject(new Vector2(int.Parse(m_currentCommand[2]), int.Parse(m_currentCommand[3])), m_currentCommand[4])); } else if (m_currentCommand[0].Equals("removeGui", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length == 1) { throw new ParseException(); } m_guis.Remove(int.Parse(m_commands[1])); } else if (m_currentCommand[0].Equals("setLayer", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length < 2) { throw new ParseException(); } m_guis[int.Parse(m_currentCommand[1])].setLayer(((float)int.Parse(m_currentCommand[2]) / 1000f)); } else if (m_currentCommand[0].Equals("addText", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length < 10) { throw new ParseException(); } m_guis.Add(int.Parse(m_currentCommand[1]), new Text(new Vector2(int.Parse(m_currentCommand[2]), int.Parse(m_currentCommand[3])), m_currentCommand[4], m_currentCommand[5], new Color(int.Parse(m_currentCommand[6]),int.Parse(m_currentCommand[7]),int.Parse(m_currentCommand[8]),int.Parse(m_currentCommand[8])),false)); } else if (m_currentCommand[0].Equals("removeText", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length == 1) { throw new ParseException(); } m_guis.Remove(int.Parse(m_currentCommand[1])); } else if (m_currentCommand[0].Equals("sound", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length == 1) { throw new ParseException(); } new Sound(m_currentCommand[1]).play(); } else if (m_currentCommand[0].Equals("setCamera", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length == 1) { throw new ParseException(); } m_waiting = true; m_cameraMoveTo = new Vector2(float.Parse(m_currentCommand[1]), float.Parse(m_currentCommand[2])); m_timeForNextCommand = (float)a_gameTime.TotalGameTime.TotalMilliseconds + float.Parse(m_currentCommand[3]); m_timeStart = (float)a_gameTime.TotalGameTime.TotalMilliseconds; return false; } else if (m_currentCommand[0].Equals("addParticle", StringComparison.OrdinalIgnoreCase)) { if (m_currentCommand.Length == 1) { throw new ParseException(); } m_objects.AddLast(new Particle(new Vector2(float.Parse(m_currentCommand[1]),float.Parse(m_currentCommand[2])),m_currentCommand[3],float.Parse(m_currentCommand[4]),float.Parse(m_currentCommand[5]))); } else if (m_currentCommand[0].Equals("addCinematic", StringComparison.OrdinalIgnoreCase)) { int t_BoxWidth = Game.getInstance().m_graphics.PreferredBackBufferWidth * 2; int t_BoxHeight = Game.getInstance().m_graphics.PreferredBackBufferHeight / 5; int t_windowHeight = Game.getInstance().m_graphics.PreferredBackBufferHeight; Box tBoxTop = new Box(new Vector2(0, 0),t_BoxWidth ,t_BoxHeight , Color.Black, false); m_objects.AddLast(tBoxTop); tBoxTop.setMove(new Vector2(-t_BoxWidth / 2, -t_windowHeight / 2 - t_BoxHeight), new Vector2(-t_BoxWidth / 2, -t_windowHeight/2), a_gameTime, 0.1f); Box tBoxBottom = new Box(new Vector2(0, Game.getInstance().m_graphics.PreferredBackBufferHeight - t_BoxHeight), t_BoxWidth, t_BoxHeight, Color.Black, false); m_objects.AddLast(tBoxBottom); tBoxBottom.setMove(new Vector2(-t_BoxWidth / 2, t_windowHeight / 2 ), new Vector2(-t_BoxWidth / 2, t_windowHeight/2 - t_BoxHeight), a_gameTime, 0.1f); } else { throw new ParseException(); } return true; }
private void removeDialog() { m_inputFeedback = null; m_buttons.Remove(m_btnYes); m_buttons.Remove(m_btnNo); m_btnYes = null; m_btnNo = null; m_dialogBackground = null; m_countDown = null; }
private void createDialog(string a_text) { Vector2 t_halfRes = Game.getInstance().getResolution() / 2; m_inputFeedback = new Text(t_halfRes, a_text, "VerdanaBold", m_normal, false); m_inputFeedback.move(new Vector2(-(m_inputFeedback.getBox().Width / 2), -100)); m_buttons.AddLast(m_btnYes = new TextButton(new Vector2(t_halfRes.X - 175, t_halfRes.Y), "YES", "MotorwerkLarge", m_normal, m_hover, m_pressed, Color.Red)); m_buttons.AddLast(m_btnNo = new TextButton(new Vector2(t_halfRes.X + 65, t_halfRes.Y), "NO", "MotorwerkLarge", m_normal, m_hover, m_pressed, Color.Red)); m_btnYes.m_clickEvent += new TextButton.clickDelegate(buttonYes); m_btnNo.m_clickEvent += new TextButton.clickDelegate(buttonNo); m_dialogBackground = new Box(new Vector2(t_halfRes.X - 200, t_halfRes.Y - 125), 400, 220, Color.Gray, true); }