public override void _Ready() { var size = GetViewportRect().Size; _infoLabel = new RichTextLabel { Name = "InfoLabel", RectMinSize = size * new Vector2(1, 0.5f), RectPosition = new Vector2(12, 12), BbcodeEnabled = true, BbcodeText = GenerateInfoText(), MouseFilter = MouseFilterEnum.Ignore }; _infoLabel.AddFontOverride("normal_font", Assets.SimpleDefaultFont.Monospace); _infoLabel.AddFontOverride("bold_font", Assets.SimpleDefaultFont.Monospace.CloneWithSize(20)); AddChild(_infoLabel); _cellLabel = new RichTextLabel { Name = "CellLabel", RectMinSize = size * new Vector2(1, 0.75f), RectPosition = (size * new Vector2(0, 0.25f)) + new Vector2(12, 12), BbcodeEnabled = true, BbcodeText = GenerateCellText(), MouseFilter = MouseFilterEnum.Ignore }; _cellLabel.AddFontOverride("normal_font", Assets.SimpleDefaultFont.Monospace); AddChild(_cellLabel); }
public override void _Ready() { base._Ready(); _totalActionsBackground = GetNode <TextureRect>("TotalActionsBackground"); _totalActionsLabel = _totalActionsBackground.GetNode <RichTextLabel>("TotalActionsLabel"); _correctActionsBackground = GetNode <TextureRect>("CorrectActionsBackground"); _correctActionsMarker = _correctActionsBackground.GetNode <TextureRect>("CorrectActionsMarker"); _totalActionsBackground.Texture = (Texture)GD.Load($"{_resourcesPath}time_background.png"); _totalActionsBackground.RectPosition = new Vector2(600, -10); _correctActionsBackground.Texture = (Texture)GD.Load($"{_qualityHudResourcesPath}correct_actions_background.png"); _correctActionsBackground.RectPosition = new Vector2(835, -10); _correctActionsMarker.Texture = (Texture)GD.Load($"{_qualityHudResourcesPath}correct_actions_marker.png"); _correctActionsMarker.RectPivotOffset = new Vector2(10, 49); _correctActionsMarker.RectPosition = new Vector2(133, 17); _correctActionsMarker.RectRotation = -75; var labelFont = (DynamicFont)GD.Load($"{_resourcesPath}bebas_neue_actions.tres"); labelFont.Size = 24; _totalActionsLabel.RectPosition = new Vector2(70, 28); _totalActionsLabel.RectMinSize = new Vector2(350, 30); _totalActionsLabel.AddFontOverride("normal_font", labelFont); _totalActionsLabel.BbcodeEnabled = true; _totalActionsLabel.ScrollActive = false; _popupPackedScene = (PackedScene)GD.Load($"res://Scenes/HUD/Gamified/GamifiedTaskCompletedPopup.tscn"); }
public override void _Ready() { base._Ready(); _actionsBackground = GetNode <TextureRect>("ActionsBackground"); _actionsLabelsContainer = _actionsBackground.GetNode <VBoxContainer>("ActionsLabelsContainer"); _completedActionsLabel = _actionsLabelsContainer.GetNode <RichTextLabel>("CompletedActionsLabel"); _correctActionsLabel = _actionsLabelsContainer.GetNode <RichTextLabel>("CorrectActionsLabel"); var labelsFont = (DynamicFont)GD.Load($"{_resourcesPath}bebas_neue_actions.tres"); labelsFont.Size = 25; _completedActionsLabel.AddFontOverride("normal_font", labelsFont); _correctActionsLabel.AddFontOverride("normal_font", labelsFont); _actionsBackground.Texture = (Texture)GD.Load($"{_resourcesPath}time_background.png"); _actionsBackground.RectPosition = new Vector2(800, -10); _actionsLabelsContainer.RectPosition = new Vector2(70, 15); _actionsLabelsContainer.Set("custom_constants/separation", -2); _completedActionsLabel.RectMinSize = new Vector2(250, 30); _completedActionsLabel.BbcodeEnabled = true; _completedActionsLabel.ScrollActive = false; _correctActionsLabel.RectMinSize = new Vector2(250, 30); _correctActionsLabel.BbcodeEnabled = true; _correctActionsLabel.ScrollActive = false; }
public override void _Ready() { base._Ready(); _actionsBackground = GetNode <TextureRect>("ActionsBackground"); _actionsLabelsContainer = _actionsBackground.GetNode <VBoxContainer>("ActionsLabelsContainer"); _completedActionsLabel = _actionsLabelsContainer.GetNode <RichTextLabel>("CompletedActionsLabel"); _correctActionsLabel = _actionsLabelsContainer.GetNode <RichTextLabel>("CorrectActionsLabel"); var labelsFont = (DynamicFont)GD.Load($"{_simpleHudResourcesPath}montserrat_bold.tres"); labelsFont.Size = 24; _completedActionsLabel.AddFontOverride("normal_font", labelsFont); _correctActionsLabel.AddFontOverride("normal_font", labelsFont); _actionsBackground.Texture = (Texture)GD.Load($"{_simpleHudResourcesPath}actions_background.png"); _actionsBackground.RectPosition = new Vector2(650, 0); _actionsLabelsContainer.RectPosition = new Vector2(30, 15); _completedActionsLabel.RectMinSize = new Vector2(250, 30); _completedActionsLabel.BbcodeEnabled = true; _completedActionsLabel.ScrollActive = false; _correctActionsLabel.RectMinSize = new Vector2(250, 30); _correctActionsLabel.BbcodeEnabled = true; _correctActionsLabel.ScrollActive = false; }
// Creates the UI control for the debug screen private void CreateControls() { DisplayLabel = new RichTextLabel(); DisplayLabel.Name = nameof(DisplayLabel); DisplayLabel.Text = ""; DisplayLabel.MouseFilter = MouseFilterEnum.Ignore; DisplayLabel.RectMinSize = GetViewport().GetVisibleRect().Size; if (DebugMenu.GetFont() != null) { DisplayLabel.AddFontOverride("normal_font", DebugMenu.GetFont()); } AddChild(DisplayLabel); }
public Country() { DynamicFont font = new DynamicFont(); DynamicFontData data = new DynamicFontData(); data.SetFontPath("res://Fonts/good times rg.ttf"); font.SetFontData(data); font.Size = 20; font.UseFilter = true; numberOfTroopsTxt.RectSize = new Vector2(30, 30); numberOfTroopsTxt.AddFontOverride("normal_font", font); numberOfTroopsTxt.PushAlign(RichTextLabel.Align.Center); numberOfTroops.Texture = texture; owner = null; troops = 0; }