public SelectedUnitTile(Screen screen, Renderer renderer, Rectangle rect) { Rect = rect; Tile = new Button(screen, renderer, Rect); Rectangle picRect = new Rectangle(rect.X, rect.Y, rect.Width / 4, rect.Height); int picSide = (picRect.Width < picRect.Height) ? picRect.Width : picRect.Height; UnitPicture = new RenderableElement(screen, renderer, new Rectangle(picRect.X + (picRect.Width - picSide) / 2, picRect.Y + (picRect.Height - picSide) / 2, picSide, picSide)); UnitName = new TextElement(screen, renderer, new Rectangle(picRect.X + picRect.Width, picRect.Y, (int)(rect.Width * (3.0 / 8)), picRect.Height / 4), "No Unit Selected"); Health = new TextElement(screen, renderer, new Rectangle(picRect.X + picRect.Width, picRect.Y + (int)(picRect.Height * (.25)), (int)(rect.Width * (3.0 / 8)), picRect.Height / 4), "Health:"); Attack = new TextElement(screen, renderer, new Rectangle(Health.Rect.X + Health.Rect.Width, Health.Rect.Y, Health.Rect.Width, Health.Rect.Height), "Attack:"); Range = new TextElement(screen, renderer, new Rectangle(Health.Rect.X, Health.Rect.Y + Health.Rect.Height, Health.Rect.Width, Health.Rect.Height), "Range: "); LevelButton = new Button(screen, renderer, new Rectangle(Health.Rect.X + Health.Rect.Width, Health.Rect.Y + Health.Rect.Height, Health.Rect.Width, Health.Rect.Height), "Level: "); SquadButton = new Button(screen, renderer, new Rectangle(rect.X + rect.Width - (int)(rect.Width * .25), rect.Y + rect.Height - (int)(rect.Height * .2), (int)(rect.Width * .25), (int)(rect.Height * .2)), "Squad"); SquadButton.Rect = new Rectangle(rect.X + rect.Width - (int)(rect.Width * .25), rect.Y + rect.Height - (int)(rect.Height * .2), (int)(rect.Width * .25), (int)(rect.Height * .2)); SquadInfo = new TextElement(screen, renderer, new Rectangle(rect.X + UnitPicture.Rect.Width, rect.Y + rect.Height - rect.Height / 5, rect.Width / 2, rect.Height / 5), "No Unit Selected"); removeUnitFromSquad = false; addUnitToSquad = false; setUpNewUnit(null); }
public SelectedSquadTile(Screen screen, Renderer renderer, Rectangle frame) { Background = new RenderableElement(screen, renderer, frame); Background.Texture = TextureName.MainScreenBackground; LeaderButton = new Button(screen, renderer, new Rectangle(frame.X, frame.Y, frame.Width / 4, frame.Height)); UnitButtonPanel = new Button[6]; int panelButtonWidth = frame.Width / 4; int panelButtonHeight = frame.Height / 2; for (int i = 0; i < 3; i++) { int j = 0; UnitButtonPanel[i] = new Button(screen, renderer, new Rectangle(i * panelButtonWidth + frame.X + LeaderButton.Rect.Width, j * panelButtonHeight + frame.Y, panelButtonWidth, panelButtonHeight)); j = 1; UnitButtonPanel[i + 3] = new Button(screen, renderer, new Rectangle(i * panelButtonWidth + frame.X + LeaderButton.Rect.Width, j * panelButtonHeight + frame.Y, panelButtonWidth, panelButtonHeight)); } LeaderPicture = new RenderableElement(screen, renderer, new Rectangle(LeaderButton.Rect.X, LeaderButton.Rect.Y, LeaderButton.Rect.Width, LeaderButton.Rect.Width)); LeaderPicture.setVisibility(false); LeaderButton.hoverableTile.Highlight = false; UnitPictures = new RenderableElement[6]; for (int i = 0; i < 6; i++) { int picSide = (panelButtonWidth <= panelButtonHeight) ? panelButtonWidth : panelButtonHeight; //center on button int picOffsetX = (UnitButtonPanel[i].Rect.Width - picSide) / 2; int picOffsetY = (UnitButtonPanel[i].Rect.Height - picSide) / 2; UnitPictures[i] = new RenderableElement(screen, renderer, new Rectangle(UnitButtonPanel[i].Rect.X + picOffsetX, UnitButtonPanel[i].Rect.Y + picOffsetY, picSide, picSide)); UnitPictures[i].setVisibility(false); UnitButtonPanel[i].hoverableTile.Highlight = false; } }
/* Send the changed resources back */ private void save_changes_Click(object sender, EventArgs e) { bool did_change = reds_list_ORIGINAL.Count != submesh_count.Value; List <RenderableElement> reds_list = new List <RenderableElement>(); int i = -1; foreach (Control control in submesh_list.Controls) { if (!(control is ComboBox)) { continue; } i++; RenderableElement newRed = new RenderableElement(); newRed.model_index = ((ComboBox)control).SelectedIndex; newRed.material_index = complete_model_list[newRed.model_index].MaterialLibaryIndex; reds_list.Add(newRed); if (did_change) { continue; } if (i >= reds_list_ORIGINAL.Count) { did_change = true; } else if (reds_list[i] != reds_list_ORIGINAL[i]) { did_change = true; } } EditComplete?.Invoke(reds_list, did_change); this.Close(); }
/// <summary> /// Add a renderer. /// </summary> /// <param name="renderer"></param> public void AddRow(RenderableElement renderer) { Renderers.Add(renderer); }
public PuppetBundle(BattlePuppet puppet, RenderableElement image) { this.puppet = puppet; this.image = image; }
public ArmyInfoTile(Screen screen, Renderer renderer, Rectangle rect) { Rect = rect; background = new RenderableElement(screen, renderer, Rect); armyStats = new TextElement(screen, renderer, Rect, "Enemy Army Information"); }
internal void AddRenderableElement(RenderableElement element) { _elements.Add(element); }