private void setList() { List <HighScoreInformation> information = HighScoreData.HighScores; TextListComponent list = new TextListComponent("Fonts/MaturaOptions"); list.addText("Score: Level: Rows: Time:", new Vector2(5, 70), Color.Red); for (int i = 0; i < information.Count; i++) { int score = information[i].score; int level = information[i].level; int rows = information[i].rows; int seconds = information[i].time % 100; int minutes = information[i].time - seconds; list.addText(score.ToString(), new Vector2(20, 100 + i * 30), Color.Red); list.addText(level.ToString(), new Vector2(100, 100 + i * 30), Color.Red); list.addText(rows.ToString(), new Vector2(160, 100 + i * 30), Color.Red); if (seconds > 9) { list.addText(minutes.ToString() + ":" + seconds.ToString(), new Vector2(210, 100 + i * 30), Color.Red); } else { list.addText(minutes.ToString() + ":0" + seconds.ToString(), new Vector2(210, 100 + i * 30), Color.Red); } } list.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(list); }
private void setText() { TextListComponent textList = new TextListComponent("Fonts/MaturaOptions"); textList.addText("", new Vector2(80, 65), Color.Red); textList.addText("Score:", new Vector2(60, 130), Color.Red); textList.addText("", new Vector2(140, 130), Color.Red); textList.addText("Level:", new Vector2(60, 150), Color.Red); textList.addText("", new Vector2(140, 150), Color.Red); textList.addText("Removed:", new Vector2(60, 170), Color.Red); textList.addText(" Rows", new Vector2(150, 170), Color.Red); textList.addText("Time:", new Vector2(60, 190), Color.Red); textList.addText("", new Vector2(140, 190), Color.Red); textList.setTransitions(new FadeCollection(15, 1), new MoveCollection(new Vector2(-200, 0), 15, true), new FadeCollection(15, -1), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(textList); }
public override void dynamicInitialize() { TextListComponent list = components["Text List"] as TextListComponent; List <HighScoreInformation> information = HighScoreData.HighScores; List <string> newList = new List <string>(); newList.Add("Score: Level: Rows: Time:"); for (int i = 0; i < information.Count; i++) { int score = information[i].score; int level = information[i].level; int rows = information[i].rows; int seconds = information[i].time % 100; int minutes = information[i].time / 100; newList.Add(score.ToString()); newList.Add(level.ToString()); newList.Add(rows.ToString()); if (seconds > 9) { newList.Add(minutes.ToString() + ":" + seconds.ToString()); } else { newList.Add(minutes.ToString() + ":0" + seconds.ToString()); } } list.Texts = newList; base.dynamicInitialize(); }
private void setOptions() { SelectionComponent selections = new SelectionComponent("Fonts/MaturaOptions", new Vector2(95, 120), Color.Red); selections.addSelection("O Block"); selections.addSelection("T Block"); selections.addSelection("I Block"); selections.addSelection("J Block"); selections.addSelection("L Block"); selections.addSelection("S Block"); selections.addSelection("Z Block"); selections.addButton(new ButtonType("Menus/Arrow Button", "Menus/Arrow Pressed", new Vector2(60, 120)), 0); selections.addButton(new ButtonType("Menus/Arrow Button", "Menus/Arrow Pressed", new Vector2(194, 120), new Rectangle(194, 120, 20, 20), SpriteEffects.FlipHorizontally), 1); selections.Change += ChangeBlock; selections.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(selections); TextListComponent text = new TextListComponent("Fonts/MaturaOptions"); text.addText("Red:", new Vector2(50, 155), Color.Red); text.addText("Green:", new Vector2(50, 215), Color.Red); text.addText("Blue:", new Vector2(50, 275), Color.Red); text.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(text); NumberSlideComponent slide = new NumberSlideComponent("Menus/Meter", "Menus/Knob", new Vector2(50, 180), new Rectangle(59, 180, 157, 25)); slide.SetValue += SetRed; slide.ChangeValue += ChangeRed; slide.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(slide); slide = new NumberSlideComponent("Menus/Meter", "Menus/Knob", new Vector2(50, 240), new Rectangle(59, 240, 157, 25)); slide.SetValue += SetGreen; slide.ChangeValue += ChangeGreen; slide.Identifier = "Number Slide 2"; slide.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(slide); slide = new NumberSlideComponent("Menus/Meter", "Menus/Knob", new Vector2(50, 300), new Rectangle(59, 300, 157, 25)); slide.SetValue += SetBlue; slide.ChangeValue += ChangeBlue; slide.Identifier = "Number Slide 3"; slide.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(slide); OptionsComponent options = new OptionsComponent("Fonts/MaturaOptions"); OptionType option = new OptionType(new OptionType("Save", new Vector2(136, 390), Color.Red, OptionAction.previous, true, true, "Menus/Highlighter", new Vector2(137, 390))); option.Selected += SaveColors; options.addOption(option); option = new OptionType(new OptionType("Cancel", new Vector2(136, 420), Color.Red, OptionAction.previous, true, true, "Menus/Highlighter", new Vector2(137, 420))); option.Selected += DiscardColors; options.addOption(option); options.setAlignment(TextAlignment.center); options.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false)); addComponent(options); }