Ejemplo n.º 1
0
    public void _on_Player_DeadSignal()
    {
        string killCountText = "Total Seagull Killed: " + Score.instance.KillCount;

        endingContainer.GetNode <Label>("VBoxContainer/KillCount").Text = killCountText;

        string maxHeightText = "Maximum Height Reached: " + Score.instance.MaxHeight;

        endingContainer.GetNode <Label>("VBoxContainer/MaxHeight").Text = maxHeightText;

        endingContainer.Show();
    }
Ejemplo n.º 2
0
 public override void _Ready()
 {
     _leftButton       = GetNode <TextureButton>("LeftButton");
     _rightButton      = GetNode <TextureButton>("RightButton");
     _centerContainer  = GetNode <CenterContainer>("CenterContainer");
     _contentContainer = _centerContainer.GetNode <HBoxContainer>("ContentContainer");
 }
        /// <summary>
        /// Initializes the control with provided values.
        /// </summary>
        /// <param name="deselectedTexture">Texture of deactivated control</param>
        /// <param name="selectedTexture">Texture of activated control</param>
        /// <param name="controlValue">Value of the control</param>
        /// <param name="defaultSelected">Sets whether the control is selected by default</param>
        /// <param name="labelText">Text of the control's label</param>
        /// <param name="font">Font of the control's label</param>
        public void Init(Texture deselectedTexture, Texture selectedTexture, int controlValue, bool defaultSelected = false,
                         string labelText = null, DynamicFont font = null)
        {
            base.Init(deselectedTexture, selectedTexture, controlValue, defaultSelected);

            _labelText = labelText;
            _font      = font;

            _centerContainer = GetNode <CenterContainer>("CenterContainer");
            Label            = _centerContainer.GetNode <Label>("Label");

            Label.Align  = Label.AlignEnum.Center;
            Label.Valign = Label.VAlign.Center;

            if (!string.IsNullOrEmpty(_labelText) && _font != null)
            {
                Label.AddFontOverride("font", _font);
                Label.Text = _labelText;
            }
        }