コード例 #1
0
        void HandleControlClicked(UIMouseClickEventArgs args)
        {
            // Get the Text control acting as the Window's title
            var windowTitle = window.GetChild("WindowTitle", true) as Text;

            // Get control that was clicked
            UIElement clicked = args.Element;

            string name = "...?";

            if (clicked != null)
            {
                // Get the name of the control that was clicked
                name = clicked.Name;
            }

            // Update the Window's title text
            windowTitle.Value = $"Hello {name}!";
        }
コード例 #2
0
        void HandleControlClicked(UIMouseClickEventArgs args)
        {
            // Get the Text control acting as the Window's title
            var windowTitle = window.GetChild("WindowTitle", true) as Text;

            // Get control that was clicked
            UIElement clicked = args.Element;

            string name = "...?";
            if (clicked != null)
            {
                // Get the name of the control that was clicked
                name = clicked.Name;
            }

            // Update the Window's title text
            windowTitle.Value = $"Hello {name}!";
        }
コード例 #3
0
ファイル: MyGame.cs プロジェクト: Sateanu/IdleClicker
 private void UI_UIMouseClick(UIMouseClickEventArgs obj)
 {
     UIClicked = obj.Element != null;
 }