当前位置: 首页>>代码示例>>C#>>正文


C# Window.MouseButtonEventArgs类代码示例

本文整理汇总了C#中SFML.Window.MouseButtonEventArgs的典型用法代码示例。如果您正苦于以下问题:C# MouseButtonEventArgs类的具体用法?C# MouseButtonEventArgs怎么用?C# MouseButtonEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MouseButtonEventArgs类属于SFML.Window命名空间,在下文中一共展示了MouseButtonEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMouseButtonPressed

 protected virtual void OnMouseButtonPressed(object sender, MouseButtonEventArgs e)
 {
     foreach (var w in Widgets)
     {
         w.Update(e.X, e.Y, true);
     }
 }
开发者ID:Tetramputechture,项目名称:Ending_0.1b,代码行数:7,代码来源:Screen.cs

示例2: MouseDown

        public override bool MouseDown(MouseButtonEventArgs e)
        {
            if (!ClientArea.Contains(new Point((int)e.X, (int)e.Y))) return false;

            var spritePosition = new Point((int)e.X - Position.X + (int)_elementSprite.ImageOffset.X,
                                           (int)e.Y - Position.Y + (int)_elementSprite.ImageOffset.Y);

            // Image.ImageLockBox imgData = _elementSprite.Image.GetImageData();
            //imgData.Lock(false);

            Color pixColour = Color.Red;
            //imgData.Dispose();
            //imgData.Unlock();

            if (pixColour.A != 0)
            {
                if (Clicked != null) Clicked(this);
                _clickPoint = new Point((int)e.X - Position.X, (int)e.Y - Position.Y);
                _selected = true;
                return true;
            }

            _selected = false;
            return false;
        }
开发者ID:Tri125,项目名称:space-station-14,代码行数:25,代码来源:TargetingDummyElement.cs

示例3: ClickButton_CreateAccount

        /// <summary>
        /// Handles when the CreateAccount button is clicked.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="SFML.Window.MouseButtonEventArgs"/> instance containing the event data.</param>
        void ClickButton_CreateAccount(object sender, MouseButtonEventArgs e)
        {
            // Manually check for invalid values before checking with the server
            if (!GameData.AccountName.IsValid(_cNameText.Text))
            {
                SetError(GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.CreateAccountInvalidName));
                return;
            }

            if (!GameData.AccountPassword.IsValid(_cPasswordText.Text))
            {
                SetError(GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.CreateAccountInvalidPassword));
                return;
            }

            if (!GameData.AccountEmail.IsValid(_cEmailText.Text))
            {
                SetError(GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.CreateAccountInvalidEmail));
                return;
            }

            // Disconnect if already connected
            if (_sockets.IsConnected)
                _sockets.Disconnect();

            // Start connecting to the server
            SetMessage("Connecting to server...");

            _sockets.Connect();
        }
开发者ID:wtfcolt,项目名称:game,代码行数:35,代码来源:NewAccountScreen.cs

示例4: OnMouseButtonPressed

 public static void OnMouseButtonPressed(object sender, MouseButtonEventArgs e)
 {
     if (e.Button == Mouse.Button.Right)
     {
         EntityManager.Character.CurrentSkill.Cast(EntityManager.Character, e.X, e.Y);
     }
 }
开发者ID:StanisInt,项目名称:SoftUniHomeworks,代码行数:7,代码来源:Events.cs

示例5: MouseDown

        public override bool MouseDown(MouseButtonEventArgs e)
        {
            if (!ClientArea.Contains(e.X, e.Y)) return false;

            TargetingDummyElement prevSelection = (from element in _elements
                                                   where element.IsSelected()
                                                   select element).FirstOrDefault();

            foreach (TargetingDummyElement toClear in _elements) toClear.ClearSelected();

            foreach (TargetingDummyElement current in _elements.ToArray())
                //To array because list order changes in loop.
            {
                if (current.MouseDown(e))
                {
                    _elements = (from a in _elements
                                 orderby (a == current) ascending
                                 select a).ToList();
                    return true;
                }
            }

            if (prevSelection != null) prevSelection.Select();

            return false;
        }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:26,代码来源:TargetingDummy.cs

示例6: MouseDown

		public override bool MouseDown(MouseButtonEventArgs e)
        {
            if (ClientArea.Contains(new Point((int) e.X, (int) e.Y)))
            {
                return true;
            }
            return false;
        }
开发者ID:millpond,项目名称:space-station-14,代码行数:8,代码来源:TemplateGuiComponent.cs

示例7: CloseButtonClicked

 /// <summary>
 /// Handles when the Close button on the form is clicked.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="SFML.Window.MouseButtonEventArgs"/> instance containing the event data.</param>
 protected override void CloseButtonClicked(object sender, MouseButtonEventArgs e)
 {
     // Since we have to let the server know what our chat state is, we can't just close the window. Instead,
     // make a request to the server that we want to end the chat dialog. If the server allows it, then it
     // will eventually close.
     if (RequestEndDialog != null)
         RequestEndDialog.Raise(this, EventArgs.Empty);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:13,代码来源:NPCChatDialogForm.cs

示例8: MouseUp

 public override bool MouseUp(MouseButtonEventArgs e)
 {
     if (ClientArea.Contains(e.X, e.Y))
     {
         return true;
     }
     return false;
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:8,代码来源:TargetingGui.cs

示例9: Window_MouseButtonPressed

		/// <summary>
		/// Funkcja wywoływana przez zdazrenie wcisniecia klawisza myszy
		/// </summary>
		/// <param name="sender">obiekt wysylajacy zdarzenie</param>
		/// <param name="e">argumenty zdarzenia</param>
		public virtual void Window_MouseButtonPressed(object sender, MouseButtonEventArgs e) {
			if ( InsideElement(e.X, e.Y) ) {
				EventHandler<MouseButtonEventArgs> handler = MouseButtonPressed;
				handler?.Invoke(sender, e);
			}
			if ( IsSelected ) {

			}
		}
开发者ID:mateuszwon94,项目名称:Praca-in-ynierska,代码行数:14,代码来源:Beeing.cs

示例10: MouseDown

 public override bool MouseDown(MouseButtonEventArgs e)
 {
     if (ClientArea.Contains(e.X, e.Y))
     {
         ResetEntity();
         return true;
     }
     return false;
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:9,代码来源:CraftSlotUi.cs

示例11: MouseDown

 public override bool MouseDown(MouseButtonEventArgs e)
 {
     if (ClientArea.Contains(e.X, e.Y))
     {
         Value = !Value;
         return true;
     }
     return false;
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:9,代码来源:Checkbox.cs

示例12: MouseDown

        public override bool MouseDown(MouseButtonEventArgs e)
        {
            var mousePoint = new Vector2i(e.X, e.Y);

            if ((mousePoint - Position).LengthSquared() <= 3*3)
                dragging = true;

            return false;
        }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:9,代码来源:StatusEffectBar.cs

示例13: MouseDown

 public override bool MouseDown(MouseButtonEventArgs e)
 {
     if (ClientArea.Contains(e.X, e.Y))
     {
         if (Clicked != null) Clicked(this);
         return true;
     }
     return false;
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:9,代码来源:BlueprintButton.cs

示例14: MouseDown

		public override bool MouseDown(MouseButtonEventArgs e)
        {
            if (ClientArea.Contains(new Point((int) e.X, (int) e.Y)))
            {
                if (Clicked != null) Clicked(this, associatedTemplate, associatedTemplateName);
                return true;
            }
            return false;
        }
开发者ID:millpond,项目名称:space-station-14,代码行数:9,代码来源:EntitySpawnSelectButton.cs

示例15: MouseUp

 public override bool MouseUp(MouseButtonEventArgs e)
 {
     if (ClientArea.Contains(new Point((int) e.X, (int) e.Y)) &&
         IoCManager.Resolve<IUserInterfaceManager>().DragInfo.IsActive)
     {
         if (Dropped != null) Dropped(this);
         return true;
     }
     return false;
 }
开发者ID:Tri125,项目名称:space-station-14,代码行数:10,代码来源:HotbarSlot.cs


注:本文中的SFML.Window.MouseButtonEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。