예제 #1
0
 public DrawVisualiser(Drawable target)
 {
     this.target = target;
 }
예제 #2
0
 public VisualisedDrawable(Drawable d)
 {
     Target = d;
 }
 public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => Original.UpdateSubTreeMasking(this, maskingBounds);
예제 #4
0
            public override void Load()
            {
                base.Load();

                Target.OnInvalidate += onInvalidate;

                AutoSizeContainer da = Target as AutoSizeContainer;

                if (da != null)
                {
                    da.OnAutoSize += onAutoSize;
                }

                FlowContainer df = Target as FlowContainer;

                if (df != null)
                {
                    df.OnLayout += onLayout;
                }

                activityAutosize = new Box()
                {
                    Colour   = Color4.Red,
                    Size     = new Vector2(2, line_height),
                    Position = new Vector2(0, 0),
                    Alpha    = 0
                };

                activityLayout = new Box()
                {
                    Colour   = Color4.Orange,
                    Size     = new Vector2(2, line_height),
                    Position = new Vector2(3, 0),
                    Alpha    = 0
                };

                activityInvalidate = new Box()
                {
                    Colour   = Color4.Yellow,
                    Size     = new Vector2(2, line_height),
                    Position = new Vector2(6, 0),
                    Alpha    = 0
                };

                var sprite = Target as Sprite;

                if (sprite?.Texture != null)
                {
                    previewBox = new Sprite(sprite.Texture)
                    {
                        Scale = new Vector2((float)sprite.Texture.Width / sprite.Texture.Height, 1)
                    }
                }
                ;
                else
                {
                    previewBox = new Box()
                    {
                        Colour = Color4.White
                    }
                };

                previewBox.Position = new Vector2(9, 0);
                previewBox.Size     = new Vector2(line_height, line_height);

                text = new SpriteText()
                {
                    Position = new Vector2(24, -3),
                    Scale    = new Vector2(0.9f),
                    //FontFace = FontFace.FixedWidth
                };

                Flow.Alpha = Target.Children.Skip(64).Any() ? 0 : 1;

                Add(activityInvalidate);
                Add(activityLayout);
                Add(activityAutosize);
                Add(previewBox);
                Add(text);
                Add(Flow);

                updateSpecifics();
            }
 internal ProxyDrawable(Drawable original)
 {
     Original          = original;
     originalDrawNodes = (original as ProxyDrawable)?.originalDrawNodes ?? original.drawNodes;
 }