Example #1
0
    public CustomDropDown()
    {
        Popup = GetPopup();
        items = new List <Item>();
        tween = new Tween();

        AddChild(tween);

        cachedPopupHSeparation = Popup.GetConstant("hseparation");
        cachedPopupVSeparation = Popup.GetConstant("vseparation");

        var checkSize = Popup.GetIcon("checked").GetSize();

        // Set the custom icon size
        iconSize = new Vector2(checkSize.x - 2, checkSize.y - 2);

        Popup.RectClipContent = true;

        Connect("about_to_show", this, nameof(OnPopupAboutToShow));
        Popup.Connect("draw", this, nameof(RedrawPopup));
    }