Beispiel #1
0
 public void Clear()
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("clear");
     }
 }
Beispiel #2
0
 public void EnsureCurrentIsVisible()
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("ensure_current_is_visible");
     }
 }
Beispiel #3
0
 public void AddItem(string text, Texture icon = null, bool selectable = true)
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("add_item", text, icon, selectable);
     }
 }
Beispiel #4
0
 public void AddIconItem(Texture icon, bool selectable = true)
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("add_icon_item", icon, selectable);
     }
 }
Beispiel #5
0
 public void OpenCentered()
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("popup_centered");
     }
 }
Beispiel #6
0
 public void OpenMinimum()
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("popup_centered_minsize");
     }
 }
Beispiel #7
0
 public void Open(UIBox2?box = null)
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("popup", box?.Convert());
     }
 }
Beispiel #8
0
        public float GetAsRatio()
        {
            if (GameController.OnGodot)
            {
                return((float)SceneControl.Call("get_as_ratio"));
            }

            return((_value - _minValue) / (_maxValue - _minValue));
        }
Beispiel #9
0
 public void Clear()
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("clear");
     }
     else
     {
         _itemList.Clear();
     }
 }
Beispiel #10
0
 public void AddItem(string text, Texture icon = null, bool selectable = true)
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("add_item", text, icon, selectable);
     }
     else
     {
         var i = new Item()
         {
             Text = text, Icon = icon, Selectable = selectable
         };
         _itemList.Add(i);
     }
 }
Beispiel #11
0
        public void Open(UIBox2?box = null)
        {
            if (GameController.OnGodot)
            {
                SceneControl.Call("popup", box?.Convert());
            }
            else
            {
                if (box != null)
                {
                    Position = box.Value.TopLeft;
                    Size     = box.Value.Size;
                }

                Visible = true;
            }
        }
Beispiel #12
0
        public void Open(UIBox2?box = null)
        {
            if (GameController.OnGodot)
            {
                SceneControl.Call("popup", box?.Convert());
            }
            else
            {
                if (box != null)
                {
                    Position = box.Value.TopLeft;
                    Size     = box.Value.Size;
                }

                Visible = true;
                UserInterfaceManagerInternal.PushModal(this);
            }
        }
Beispiel #13
0
 public int GetItemAtPosition(Vector2 position, bool exact = false)
 {
     return(GameController.OnGodot ? (int)SceneControl.Call("get_item_at_position", position.Convert(), exact) : default);
Beispiel #14
0
 public float GetAsRatio()
 {
     return(GameController.OnGodot ? (float)SceneControl.Call("get_as_ratio") : default);