/// <summary> /// Loads the content. /// </summary> public override void LoadContent() { icon = new GuiImage(); images = new List <GuiImage>(); text = new GuiText(); for (int x = 0; x < ButtonSize.Width; x++) { GuiImage image = new GuiImage { SourceRectangle = CalculateSourceRectangle(x) }; images.Add(image); } Children.AddRange(images); Children.Add(text); if (!string.IsNullOrWhiteSpace(Icon)) { Children.Add(icon); } base.LoadContent(); }
public override void LoadContent() { regularBackground = new GuiImage { ContentFile = "Interface/skillcard" }; detailsBackground = new GuiImage { ContentFile = "Interface/skillcard_details" }; skillIcon = new GuiImage { ContentFile = SkillIcon }; currentLevelText = new GuiText { FontName = "SkillCardFont", FontOutline = FontOutline.BottomRight, Size = new Size2D(12, 10), ForegroundColour = Colour.Yellow }; baseLevelText = new GuiText { FontName = "SkillCardFont", FontOutline = FontOutline.BottomRight, Size = new Size2D(12, 10), ForegroundColour = Colour.Yellow }; detailsText = new GuiText { FontName = "SkillCardFont", Size = new Size2D(12, 10), ForegroundColour = Colour.Yellow }; Children.Add(regularBackground); Children.Add(detailsBackground); Children.Add(skillIcon); Children.Add(currentLevelText); Children.Add(baseLevelText); Children.Add(detailsText); detailsBackground.Visible = false; detailsText.Visible = false; base.LoadContent(); }
public override void LoadContent() { background = new GuiImage { ContentFile = "Interface/combatcard" }; icon = new GuiImage(); nameText = new GuiText { FontName = "SkillCardFont", FontOutline = FontOutline.BottomRight, HorizontalAlignment = HorizontalAlignment.Top }; Children.Add(background); Children.Add(icon); Children.Add(nameText); base.LoadContent(); }
protected override void SetChildrenProperties() { background.Size = Size; background.Location = Location; background.TintColour = BackgroundColour; // Add additional rows if there is enough room (the chat panel was expanded) while (Size.Height - (messageRows.Count * MessageHeight) >= MessageHeight) { GuiText newRow = new GuiText { FontName = "ChatFont", VerticalAlignment = VerticalAlignment.Left }; newRow.LoadContent(); Children.Add(newRow); messageRows.Insert(0, newRow); } // Remove extra rows if there is not enough room (the chat panel was shrunk) while (Size.Height < MessageHeight * messageRows.Count) { messageRows.RemoveAt(0); } // Update the properties of int y = ClientRectangle.Bottom - MessageHeight; for (int i = messageRows.Count - 1; i >= 0; i--) { GuiText message = messageRows[i]; message.Size = new Size2D(Size.Width, MessageHeight); message.ForegroundColour = ForegroundColour; message.Location = new Point2D(Location.X, y); y -= message.Size.Height; } base.SetChildrenProperties(); }
public override void LoadContent() { icon = new GuiImage { Size = new Size2D(32, 32), ContentFile = "Interface/items" }; quantity = new GuiText { Size = new Size2D(Size.Width, 10), FontName = "ItemCardFont", FontOutline = FontOutline.BottomRight, HorizontalAlignment = HorizontalAlignment.Top, VerticalAlignment = VerticalAlignment.Left }; Children.Add(icon); Children.Add(quantity); base.LoadContent(); }
public override void LoadContent() { combatLevelText = new GuiText { Size = new Size2D(Size.Width, 24) }; controlledStyleCard = new GuiCombatStyleCard { Size = new Size2D(72, 48), CombatStyleName = "Controlled", Icon = "Icons/CombatStyles/controlled" }; aggressiveStyleCard = new GuiCombatStyleCard { Size = new Size2D(72, 48), CombatStyleName = "Aggressive", Icon = "Icons/CombatStyles/aggressive" }; accurateStyleCard = new GuiCombatStyleCard { Size = new Size2D(72, 48), CombatStyleName = "Accurate", Icon = "Icons/CombatStyles/accurate" }; defensiveStyleCard = new GuiCombatStyleCard { Size = new Size2D(72, 48), CombatStyleName = "Defensive", Icon = "Icons/CombatStyles/defensive" }; Children.Add(combatLevelText); Children.Add(controlledStyleCard); Children.Add(aggressiveStyleCard); Children.Add(accurateStyleCard); Children.Add(defensiveStyleCard); base.LoadContent(); }