本文整理汇总了C#中SFML.Window.MouseMoveEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# MouseMoveEventArgs类的具体用法?C# MouseMoveEventArgs怎么用?C# MouseMoveEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseMoveEventArgs类属于SFML.Window命名空间,在下文中一共展示了MouseMoveEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.X, (int) e.Y)))
_color = Color.LightSteelBlue;
else
_color = Color.White;
}
示例2: OnMouseMoved
private void OnMouseMoved(object sender, MouseMoveEventArgs e)
{
foreach (var w in Widgets)
{
w.Update(e.X, e.Y, false);
}
}
示例3: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
if (ClientArea.Contains(e.X, e.Y))
_color = new Color(176, 222, 196);
else
_color = Color.White;
}
示例4: EventToWindowPos
/// <summary>
/// Returns event position of MouseMoveEvent where it would be if the window wasn't resized
/// See Terminology above
/// </summary>
public MouseMoveEventArgs EventToWindowPos(MouseMoveEventArgs mouseMoveEvent)
{
Vector2i windowPos = (Vector2i)_window.MapPixelToCoords(
new Vector2i((int)mouseMoveEvent.X, (int)mouseMoveEvent.Y), _interfaceView);
mouseMoveEvent.X = (int)windowPos.X;
mouseMoveEvent.Y = (int)windowPos.Y;
MouseMoveEvent newMouseEvent = new MouseMoveEvent();
newMouseEvent.X = windowPos.X;
newMouseEvent.Y = windowPos.Y;
MouseMoveEventArgs eventArgsWindowPos = new MouseMoveEventArgs(newMouseEvent);
return eventArgsWindowPos;
}
示例5: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
if (ClientArea.Contains(e.X, e.Y))
{
_buttonLeft.MouseMove(e);
_buttonRight.MouseMove(e);
foreach (var curr in _items)
{
curr.Key.MouseMove(e);
}
}
}
示例6: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
if (dragging)
{
Position = new Vector2i((int) e.X, (int) e.Y);
}
else
{
foreach (StatusEffectButton button in buttons)
{
button.MouseMove(e);
}
}
}
示例7: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
if (disposing || !IsVisible()) return;
base.MouseMove(e);
}
示例8: MouseMove
public void MouseMove ( MouseMoveEventArgs e )
{
UserInterfaceManager.MouseMove(e);
}
示例9: OnMouseMove
private void OnMouseMove(object sender, MouseMoveEventArgs e)
{
}
示例10: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.X, (int) e.Y)))
{
showTooltip = true;
tooltipPos = new Point((int) e.X, (int) e.Y);
}
else
showTooltip = false;
}
示例11: MouseMoved
public void MouseMoved ( MouseMoveEventArgs e )
{
}
示例12: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
_bgcol = ClientArea.Contains(e.X, e.Y)
? new SFML.Graphics.Color(70, 130, 180)
: Color.Transparent;
}
示例13: OnMouseMoved
/// <summary>
/// Handles when the mouse has moved over the <see cref="Control"/>.
/// This is called immediately before <see cref="Control.MouseMoved"/>.
/// Override this method instead of using an event hook on <see cref="Control.MouseMoved"/> when possible.
/// </summary>
/// <param name="e">The event args.</param>
protected override void OnMouseMoved(MouseMoveEventArgs e)
{
base.OnMouseMoved(e);
_state = CheckBoxState.Over;
}
示例14: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
_currentColor = ClientArea.Contains(e.X, e.Y)
? new SFML.Graphics.Color(211, 211, 211)
: new SFML.Graphics.Color(128, 128, 128);
}
示例15: OnMouseMove
private void OnMouseMove(object sender, MouseMoveEventArgs e)
{
RenderWindow window = (RenderWindow)sender;
if (down && (MainViewer.Instance.CurrentTool == (int)ToolType.Pencil || MainViewer.Instance.CurrentTool == (int)ToolType.Eraser))
{
x1 = lastposition.X / zoom + OffsetX;
y1 = lastposition.Y / zoom + OffsetY;
lastposition = new Vector2f(e.X, e.Y);
x2 = lastposition.X / zoom + OffsetX;
y2 = lastposition.Y / zoom + OffsetY;
differenceX = x1 - x2;
differenceY = y1 - y2;
Console.Out.WriteLine(zoom);
if (differenceX == 0)
{
if (differenceY <= 0)
{
vertexesToDraw[0] = new Vector2f(x1 - halfSize, y1 - halfSize);
vertexesToDraw[1] = new Vector2f(x1 + halfSize, y1 - halfSize);
vertexesToDraw[2] = new Vector2f(x1 - halfSize, y1 + halfSize);
vertexesToDraw[3] = new Vector2f(x2 + halfSize, y2 + halfSize);
vertexesToDraw[4] = new Vector2f(x2 - halfSize, y2 + halfSize);
vertexesToDraw[5] = new Vector2f(x2 - halfSize, y2 + halfSize);
}
else
{
vertexesToDraw[0] = new Vector2f(x1 + halfSize, y1 + halfSize);
vertexesToDraw[1] = new Vector2f(x1 - halfSize, y1 + halfSize);
vertexesToDraw[2] = new Vector2f(x1 + halfSize, y1 - halfSize);
vertexesToDraw[3] = new Vector2f(x2 - halfSize, y2 - halfSize);
vertexesToDraw[4] = new Vector2f(x2 + halfSize, y2 - halfSize);
vertexesToDraw[5] = new Vector2f(x2 + halfSize, y2 - halfSize);
}
}
else if (differenceX < 0)
{
if (differenceY <= 0)
{
vertexesToDraw[0] = new Vector2f(x1 - halfSize, y1 - halfSize);
vertexesToDraw[1] = new Vector2f(x1 + halfSize, y1 - halfSize);
vertexesToDraw[2] = new Vector2f(x1 - halfSize, y1 + halfSize);
vertexesToDraw[3] = new Vector2f(x2 + halfSize, y2 - halfSize);
vertexesToDraw[4] = new Vector2f(x2 - halfSize, y2 + halfSize);
vertexesToDraw[5] = new Vector2f(x2 + halfSize, y2 + halfSize);
}
else
{
vertexesToDraw[0] = new Vector2f(x1 - halfSize, y1 + halfSize);
vertexesToDraw[1] = new Vector2f(x1 - halfSize, y1 - halfSize);
vertexesToDraw[2] = new Vector2f(x1 + halfSize, y1 + halfSize);
vertexesToDraw[3] = new Vector2f(x2 - halfSize, y2 - halfSize);
vertexesToDraw[4] = new Vector2f(x2 + halfSize, y2 + halfSize);
vertexesToDraw[5] = new Vector2f(x2 + halfSize, y2 - halfSize);
}
}
else
{
if (differenceY <= 0)
{
vertexesToDraw[0] = new Vector2f(x1 + halfSize, y1 - halfSize);
vertexesToDraw[1] = new Vector2f(x1 - halfSize, y1 - halfSize);
vertexesToDraw[2] = new Vector2f(x1 + halfSize, y1 + halfSize);
vertexesToDraw[3] = new Vector2f(x2 - halfSize, y2 - halfSize);
vertexesToDraw[4] = new Vector2f(x2 + halfSize, y2 + halfSize);
vertexesToDraw[5] = new Vector2f(x2 - halfSize, y2 + halfSize);
}
else
{
vertexesToDraw[0] = new Vector2f(x1 + halfSize, y1 + halfSize);
vertexesToDraw[1] = new Vector2f(x1 - halfSize, y1 + halfSize);
vertexesToDraw[2] = new Vector2f(x1 + halfSize, y1 - halfSize);
vertexesToDraw[3] = new Vector2f(x2 - halfSize, y2 + halfSize);
vertexesToDraw[4] = new Vector2f(x2 + halfSize, y2 - halfSize);
vertexesToDraw[5] = new Vector2f(x2 - halfSize, y2 - halfSize);
}
}
switch (MainViewer.Instance.CurrentTool)
{
case (int)ToolType.Pencil:
for (int i = 0; i < 6; i++)
{
lines.Append(new Vertex(vertexesToDraw[i], MainViewer.Instance.PickedColor[MainViewer.Instance.CurrentSelectedColor]));
}
break;
case (int)ToolType.Eraser:
for (int i = 0; i < 6; i++)
{
transparent.Append(new Vertex(vertexesToDraw[i], new SFML.Graphics.Color(0, 0, 0, 0)));
//.........这里部分代码省略.........