Beispiel #1
0
        RectangleF GetMyRectangle(UiContext context, RectangleF parentRectangle)
        {
            var myPos = context.AnchorPosition(parentRectangle, Anchor, X, Y, Width, Height);

            Update(context, myPos);
            myPos = AnimatedPosition(myPos);
            var myRect = new RectangleF(myPos.X, myPos.Y, Width, Height);

            return(myRect);
        }
Beispiel #2
0
        public override void OnMouseClick(UiContext context, RectangleF parentRectangle)
        {
            if (!Visible)
            {
                return;
            }
            var myPos       = context.AnchorPosition(parentRectangle, Anchor, X, Y, Width, Height);
            var myRectangle = new RectangleF(myPos.X, myPos.Y, Width, Height);

            foreach (var child in Children)
            {
                child.OnMouseClick(context, myRectangle);
            }
        }
Beispiel #3
0
        public override void Render(UiContext context, RectangleF parentRectangle)
        {
            if (!Visible)
            {
                return;
            }
            var myPos       = context.AnchorPosition(parentRectangle, Anchor, X, Y, Width, Height);
            var myRectangle = new RectangleF(myPos.X, myPos.Y, Width, Height);

            Background?.Draw(context, myRectangle);
            foreach (var child in Children)
            {
                child.Render(context, myRectangle);
            }
        }