private void Init() { // Init buttons bAllies = new List <List <ColoredButton> >(); bRivals = new List <List <ColoredButton> >(); for (int i = 0; i < rows; i++) { bAllies.Add(new List <ColoredButton>()); bRivals.Add(new List <ColoredButton>()); for (int j = 0; j < cols; j++) { ColoredButton ba = new ColoredButton(); ba.Name = "buttona" + i.ToString() + j.ToString(); ba.SetColor(ColorType.empty); bAllies[i].Add(ba); this.tableAllies.Attach(ba, Convert.ToUInt32(i), Convert.ToUInt32(i) + 1, Convert.ToUInt32(j), Convert.ToUInt32(j) + 1); ba.Clicked += OnButtonAlliesClicked; ba.Show(); ColoredButton br = new ColoredButton(); br.Name = "buttonr" + i.ToString() + j.ToString(); br.SetColor(ColorType.closed); bRivals[i].Add(br); this.tableRival.Attach(br, Convert.ToUInt32(i), Convert.ToUInt32(i) + 1, Convert.ToUInt32(j), Convert.ToUInt32(j) + 1); br.Clicked += OnButtonRivalsClicked; br.Show(); } } }
public void Setup(string bannerName) { Texture banner1st = Texture.FromResources("HopeEngineSampleGame.Resources.images.ui.banners.banner_1st.png", typeof(SummonBanner)); Text text = new Text(bannerName) { FontSize = 23 }; text.SetTextHorizontalAlign(TextHorizontalAlignment.CENTER); text.SetTextVerticalAlign(TextVerticalAlignment.CENTER); text.Prepare(); // TODO elements added after setup cause problems due to prepare not called Square bannerImage = new Square(banner1st); bannerImage.Transform.Scale.X = 1700; bannerImage.Transform.Scale.Y = 800; bannerImage.Transform.Position.X = Transform.Scale.X / 2.0f - 1700 / 2.0f; bannerImage.Transform.Position.Y = Transform.Scale.Y / 2.0f - 800 / 2.0f; float bannerTopMargin = 100; float buttonRightMargin = 100; float buttonMargin = 100; ColoredButton gatcha1x = new ColoredButton("Summon x1", Color.White); ColoredButton gatcha11x = new ColoredButton("Summon x10+1", Color.White); bannerImage.AddComponents(gatcha1x, gatcha11x); gatcha1x.Text.Color = Color.Black; gatcha11x.Text.Color = Color.Black; gatcha1x.Transform.Scale = new Vector3(300, 150, 0); gatcha11x.Transform.Scale = new Vector3(300, 150, 0); gatcha11x.Transform.Position.X = bannerImage.Transform.Scale.X - buttonRightMargin; gatcha1x.Transform.Position.X = bannerImage.Transform.Scale.X - buttonMargin - buttonRightMargin - 300; gatcha1x.Transform.Position.Y = bannerImage.Transform.Position.Y + bannerImage.Transform.Scale.Y - 150; gatcha11x.Transform.Position.Y = bannerImage.Transform.Position.Y + bannerImage.Transform.Scale.Y - 150; gatcha1x.Text.SetTextVerticalAlign(TextVerticalAlignment.CENTER); gatcha1x.Text.SetTextHorizontalAlign(TextHorizontalAlignment.CENTER); gatcha11x.Text.SetTextVerticalAlign(TextVerticalAlignment.CENTER); gatcha11x.Text.SetTextHorizontalAlign(TextHorizontalAlignment.CENTER); _verticalMovementLeft = -Hope.ScreenSize.Y; _startingMovementLeft = -Hope.ScreenSize.Y; AddComponents(bannerImage, text, gatcha1x, gatcha11x); }
public static string Generate() { var button1 = new ColoredButton("Default", IconClass.Default); var button2 = new ColoredButton("Primary", IconClass.Primary); var button3 = new ColoredButton("Info", IconClass.Info); var button4 = new ColoredButton("Success", IconClass.Success); var button5 = new ColoredButton("Warning", IconClass.Warning); var button6 = new ColoredButton("Danger", IconClass.Danger); var button7 = new ColoredButton("Rose", IconClass.Rose); return(button1.ToHtml() + " " + button2.ToHtml() + button3.ToHtml() + button4.ToHtml() + button5.ToHtml() + button6.ToHtml() + button7.ToHtml()); }
protected IActionResult CommonReplaces(string htmlName) { var html = this.getHtml.GetContent(htmlName); var script = TagHelper.ToHtml(HtmlHelper.GetBodyScript()); html = html.Replace("{{script}}", script); var css = TagHelper.ToHtml(HtmlHelper.GetHeadCss()); html = html.Replace("{{css}}", css); html = html.Replace("{{copyright}}", HtmlHelper.GetCopyRight()); html = html.Replace("{{navbar}}", Navigation.GetNavbar()); html = html.Replace("{{footernav}}", HtmlHelper.GetFooter()); if (htmlName == HtmlFile.ContactUsHtml) { html = html.Replace("navbar navbar-primary navbar-transparent navbar-absolute", "navbar navbar-inverse navbar-fixed-top"); } if (htmlName == HtmlFile.IndexHtml) { html = html.Replace("{{ManualRotatingCards}}", new ManualRotatingCard().ToHtml()); html = html.Replace("{{table}}", new Table().ToHtml()); html = html.Replace("{{Tooltips}}", Tooltip.Generate()); html = html.Replace("{{Popovers}}", Popovers.Generate()); html = html.Replace("{{buttons}}", Button.Generate()); html = html.Replace("{{pickSizeButtons}}", XSmallButton.Generate()); html = html.Replace("{{ColoredButton}}", ColoredButton.Generate()); html = html.Replace("{{Input}}", LabeledInput.Generate()); html = html.Replace("{{Checkbox}}", Checkbox.Generate()); html = html.Replace("{{RadioButton}}", RadioButton.Generate()); html = html.Replace("{{ToggleButton}}", ToggleButton.Generate()); html = html.Replace("{{Dropdown}}", new Dropdown().ToHtml()); html = html.Replace("{{Textarea}}", new Textarea().ToHtml()); html = html.Replace("{{SelectPicker}}", new SingleSelect().ToHtml()); html = html.Replace("{{MultipleSelect}}", new MultipleSelect().ToHtml()); html = html.Replace("{{Tags}}", new HtmlTag().ToHtml()); } if (htmlName == HtmlFile.ScheduleHtml) { html = html.Replace("{{ManualRotatingCards}}", new SchedulePage().ToHtml()); } return(this.HtmlResult(html)); }
private void initializeGame() { //DropButtonarray erstellen allButtons = new myButton[ROWS, COLUMNS]; for (int row = 0; row < ROWS; row++) { for (int column = 0; column < COLUMNS; column++) { myButton newButton; System.Drawing.Color color; if (row == 0) { newButton = new DropButton(); color = System.Drawing.ColorTranslator.FromHtml("#D8D8D8"); newButton.setColor(color); } else { newButton = new ColoredButton(); color = System.Drawing.ColorTranslator.FromHtml("#FFFFFF"); newButton.setColor(color); newButton.setTextColor(); } newButton.Enabled = false; newButton.Click += new System.EventHandler(this.dropButton_CLICK); allButtons[row, column] = newButton; //für jeden Button im Array diesen der Tabelle zuweisen. this.tableLayoutPanel1.Controls.Add(newButton); this.gamePanel.Controls.Add(tableLayoutPanel1); } } this.labelPlayerOne.Text = Connections.PlayerOne; this.labelPlayerTwo.Text = Connections.PlayerTwo; }
/// <summary> /// Methode erlaubt Änderung der Farbe von Spieler 2 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonColorPlayerTwo_Click(object sender, EventArgs e) { ColoredButton buttonClicked = (ColoredButton)sender; //TODO: Farbwähler }