• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Window.MouseButtonEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: logOutLbl_Clicked

        /// <summary>
        /// Handles the Clicked event of the logOutLbl control.
        /// </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 logOutLbl_Clicked(object sender, MouseButtonEventArgs e)
        {
            if (e.Button != Mouse.Button.Left)
                return;

            if (ClickedLogOut != null)
                ClickedLogOut.Raise(this, EventArgs.Empty);

            IsVisible = !IsVisible;
        }
开发者ID:Furt,项目名称:netgore,代码行数:15,代码来源:GameMenuForm.cs


示例17: MouseDown

 public override bool MouseDown(MouseButtonEventArgs e)
 {
     if (!base.MouseDown(e))
         if (input.MouseDown(e))
         {
             IoCManager.Resolve<IUserInterfaceManager>().SetFocus(input);
             return true;
         }
     return false;
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:10,代码来源:DebugConsole.cs


示例18: ClickButton_DeleteCharacter

        void ClickButton_DeleteCharacter(Control sender, MouseButtonEventArgs args)
        {
            var s = (CharacterSlotControl)sender;
            var ci = s.CharInfo;
            if (ci == null)
                return;

            var mb = new DeleteCharacterMessageBox(GUIManager, ci.Name, ci.Index) { Font = GameScreenHelper.DefaultChatFont };
            mb.DeleteRequested += DeleteCharacterMsgBox_DeleteRequested;
        }
开发者ID:Vizzini,项目名称:netgore,代码行数:10,代码来源:CharacterSelectionScreen.cs


示例19: EventToWindowPos

 /// <summary>
 /// Returns event position of MouseButtonEvent where it would be if the window wasn't resized
 /// See Terminology above
 /// </summary>
 public MouseButtonEventArgs EventToWindowPos(MouseButtonEventArgs mouseButtonEvent)
 {
     Vector2i windowPos = (Vector2i)_window.MapPixelToCoords(
         new Vector2i((int)mouseButtonEvent.X, (int)mouseButtonEvent.Y), _interfaceView);
     MouseButtonEvent newMouseEvent = new MouseButtonEvent();
     newMouseEvent.X = windowPos.X;
     newMouseEvent.Y = windowPos.Y;
     newMouseEvent.Button = mouseButtonEvent.Button;
     MouseButtonEventArgs eventArgsWindowPos = new MouseButtonEventArgs(newMouseEvent);
     return eventArgsWindowPos;
 }
开发者ID:millpond,项目名称:space-station-14,代码行数:15,代码来源:CluwneView.cs


示例20: MouseDown

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Window.MouseMoveEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Window.KeyEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap