本文整理汇总了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);
}
}
示例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;
}
示例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();
}
示例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);
}
}
示例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;
}
示例6: MouseDown
public override bool MouseDown(MouseButtonEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.X, (int) e.Y)))
{
return true;
}
return false;
}
示例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);
}
示例8: MouseUp
public override bool MouseUp(MouseButtonEventArgs e)
{
if (ClientArea.Contains(e.X, e.Y))
{
return true;
}
return false;
}
示例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 ) {
}
}
示例10: MouseDown
public override bool MouseDown(MouseButtonEventArgs e)
{
if (ClientArea.Contains(e.X, e.Y))
{
ResetEntity();
return true;
}
return false;
}
示例11: MouseDown
public override bool MouseDown(MouseButtonEventArgs e)
{
if (ClientArea.Contains(e.X, e.Y))
{
Value = !Value;
return true;
}
return false;
}
示例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;
}
示例13: MouseDown
public override bool MouseDown(MouseButtonEventArgs e)
{
if (ClientArea.Contains(e.X, e.Y))
{
if (Clicked != null) Clicked(this);
return true;
}
return false;
}
示例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;
}
示例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;
}