Ejemplo n.º 1
0
 public void Open(UIBox2?box = null)
 {
     if (GameController.OnGodot)
     {
         SceneControl.Call("popup", box?.Convert());
     }
 }
Ejemplo n.º 2
0
        public void DrawStyleBox(StyleBox styleBox, UIBox2 box)
        {
            if (!GameController.OnGodot)
            {
                return;
            }

            CheckDisposed();
            styleBox.GodotStyleBox.Draw(Item, box.Convert());
        }
Ejemplo n.º 3
0
 public void Draw(DrawingHandleScreen handle, UIBox2 box)
 {
     if (GameController.OnGodot)
     {
         GodotStyleBox.Draw(handle.Item, box.Convert());
     }
     else
     {
         DoDraw(handle, box);
     }
 }
Ejemplo n.º 4
0
 public void DrawTextureRect(Texture texture, UIBox2 rect, bool tile, Color?modulate = null,
                             bool transpose = false, Texture normalMap = null)
 {
     CheckDisposed();
     if (_renderHandle != null)
     {
         _renderHandle.DrawTextureRect(texture, rect.TopLeft, rect.BottomRight, modulate, _handleId);
     }
     else if (Item != null)
     {
         texture.GodotTexture.DrawRect(Item, rect.Convert(), tile, modulate?.Convert(), transpose, normalMap);
     }
 }
Ejemplo n.º 5
0
        public void DrawTextureRectRegion(Texture texture, UIBox2 rect, UIBox2 subRegion, Color?modulate = null)
        {
            CheckDisposed();
            var actualModulate = (modulate ?? Color.White) * Modulate;

            if (_renderHandle != null)
            {
                _renderHandle.DrawTextureRect(texture, rect.TopLeft, rect.BottomRight, actualModulate, subRegion, _handleId);
            }
            else if (Item != null)
            {
                texture.GodotTexture.DrawRect(Item, rect.Convert(), false, actualModulate.Convert());
            }
        }
Ejemplo n.º 6
0
 public void DrawRect(UIBox2 rect, Color color, bool filled = true)
 {
     CheckDisposed();
     if (filled)
     {
         VS.CanvasItemAddRect(Item, rect.Convert(), color.Convert());
     }
     else
     {
         DrawLine(rect.TopLeft, rect.TopRight, color);
         DrawLine(rect.TopRight, rect.BottomRight, color);
         DrawLine(rect.BottomRight, rect.BottomLeft, color);
         DrawLine(rect.BottomLeft, rect.TopLeft, color);
     }
 }
Ejemplo n.º 7
0
        public void DrawStyleBox(StyleBox styleBox, UIBox2 box)
        {
            if (styleBox == null)
            {
                throw new ArgumentNullException(nameof(styleBox));
            }

            CheckDisposed();
            if (GameController.OnGodot)
            {
                styleBox.GodotStyleBox.Draw(Item, box.Convert());
            }
            else
            {
                styleBox.Draw(this, box);
            }
        }
Ejemplo n.º 8
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;
            }
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 10
0
        public AtlasTexture(Texture texture, UIBox2 subRegion)
        {
            DebugTools.Assert(SubRegion.Right < texture.Width);
            DebugTools.Assert(SubRegion.Bottom < texture.Height);
            DebugTools.Assert(SubRegion.Left >= 0);
            DebugTools.Assert(SubRegion.Top >= 0);

            if (GameController.OnGodot)
            {
                GodotTexture = new Godot.AtlasTexture
                {
                    Atlas  = texture,
                    Region = subRegion.Convert()
                };
            }

            SubRegion     = subRegion;
            SourceTexture = texture;
        }
Ejemplo n.º 11
0
 public void DrawRect(UIBox2 rect, Color color, bool filled = true)
 {
     CheckDisposed();
     color *= Modulate;
     if (filled)
     {
         if (_renderHandle != null)
         {
             _renderHandle.DrawTextureRect(Texture.White, rect.TopLeft, rect.BottomRight, color, null, _handleId);
         }
         else if (Item != null)
         {
             VS.CanvasItemAddRect(Item, rect.Convert(), color.Convert());
         }
     }
     else
     {
         DrawLine(rect.TopLeft, rect.TopRight, color);
         DrawLine(rect.TopRight, rect.BottomRight, color);
         DrawLine(rect.BottomRight, rect.BottomLeft, color);
         DrawLine(rect.BottomLeft, rect.TopLeft, color);
     }
 }
Ejemplo n.º 12
0
 public void Open(UIBox2?box = null)
 {
     SceneControl.Popup_(box?.Convert());
 }
Ejemplo n.º 13
0
 public void SetItemIconRegion(int idx, UIBox2 region)
 {
     SceneControl.SetItemIconRegion(idx, region.Convert());
 }
Ejemplo n.º 14
0
 public void DrawTextureRect(Texture texture, UIBox2 rect, bool tile, Color?modulate = null,
                             bool transpose = false, Texture normalMap = null)
 {
     CheckDisposed();
     texture.GodotTexture.DrawRect(Item, rect.Convert(), tile, modulate?.Convert(), transpose, normalMap);
 }
Ejemplo n.º 15
0
 public void DrawStyleBox(StyleBox styleBox, UIBox2 box)
 {
     CheckDisposed();
     styleBox.GodotStyleBox.Draw(Item, box.Convert());
 }