示例#1
0
        public override void OnMouseClick(UIMouseClickEventArgs args)
        {
            if (_backgroundRect.Transform.HitTest(args.X, args.Y))
            {
                var buttonEventArgs = new UIButtonEventArgs(args.X, args.Y, args.X - (int)_backgroundRect.Transform.Position.X, args.Y - (int)_backgroundRect.Transform.Position.Y);
                var handler         = OnClick;

                handler?.Invoke(this, buttonEventArgs);
            }
        }
示例#2
0
        public void MouseClick(MouseButton button, int x, int y)
        {
            var args = new UIMouseClickEventArgs(button, x, y);

            foreach (var uiComponent in Components)
            {
                uiComponent.OnMouseClick(args);
            }

            var handler = OnMouseClick;

            handler?.Invoke(this, args);
        }
示例#3
0
 public abstract void OnMouseClick(UIMouseClickEventArgs args);