本文整理汇总了C#中EMouseButtons类的典型用法代码示例。如果您正苦于以下问题:C# EMouseButtons类的具体用法?C# EMouseButtons怎么用?C# EMouseButtons使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EMouseButtons类属于命名空间,在下文中一共展示了EMouseButtons类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMouseDown
protected override bool OnMouseDown(EMouseButtons button)
{
//If atop openly any window to not process
if (Controls.Count != 1)
return base.OnMouseDown(button);
if (button == EMouseButtons.Left)
{
if (GetPositionByCursor(out startPosition))
pathTest = true;
}
if (button == EMouseButtons.Right)
{
MapObject mapObject = GetMapObjectByCursor();
if (mapObject != null)
{
UnitAttack(mapObject);
}
else
{
Vec3 position;
if (GetPositionByCursor(out position))
UnitMove(position);
}
}
return base.OnMouseDown(button);
}
示例2: OnMouseDown
protected override bool OnMouseDown( EMouseButtons button )
{
if( button == EMouseButtons.Left )
ToggleEntity();
return base.OnMouseDown( button );
}
示例3: OnMouseUp
protected override bool OnMouseUp(EMouseButtons button)
{
//If atop openly any window to not process
if (Controls.Count != 1)
return base.OnMouseUp(button);
return base.OnMouseUp(button);
}
示例4: OnMouseDown
protected override bool OnMouseDown( EMouseButtons button )
{
if( button == EMouseButtons.Left || button == EMouseButtons.Right )
{
Destroy( true );
return true;
}
return base.OnMouseDown( button );
}
示例5: OnMouseDown
protected override bool OnMouseDown( EMouseButtons button )
{
if( button == EMouseButtons.Left )
{
if( GetPositionByCursor( out startPosition ) )
pathTest = true;
}
return base.OnMouseDown( button );
}
示例6: OnMouseDown
protected override bool OnMouseDown( EMouseButtons button )
{
//If atop openly any window to not process
if( Controls.Count != 1 )
return base.OnMouseDown( button );
if( !FreeCameraEnabled && button == EMouseButtons.Left )
{
if( IsCursorOverCatapult() )
{
catapultFiring = true;
catapultFiringMouseStartPosition = MousePosition;
return true;
}
}
if( button == EMouseButtons.Right )
{
//remove all CatapultBullet
List<Entity> list = new List<Entity>();
foreach( Entity entity in Map.Instance.Children )
{
if( entity.Type.Name == "CatapultGame_CatapultBullet" )
list.Add( entity );
}
foreach( Entity entity in list )
entity.SetForDeletion( true );
}
return base.OnMouseDown( button );
}
示例7: SystemKeyboardMouseValue
public SystemKeyboardMouseValue( EMouseButtons mouseButton )
{
type = Types.MouseButton;
this.mouseButton = mouseButton;
}
示例8: OnMouseUp
protected override bool OnMouseUp( EMouseButtons button )
{
//If atop openly any window to not process
if( Controls.Count != 1 )
return base.OnMouseUp( button );
//do tasks
if( ( button == EMouseButtons.Right || button == EMouseButtons.Left ) &&
( !FreeCameraMouseRotating || !EngineApp.Instance.MouseRelativeMode ) )
{
bool pickingSuccess = false;
Vec3 mouseMapPos = Vec3.Zero;
Unit mouseOnObject = null;
//pick on active area
if( IsMouseInActiveArea() )
{
//get pick information
Ray ray = RendererWorld.Instance.DefaultCamera.GetCameraToViewportRay(
EngineApp.Instance.MousePosition );
if( !float.IsNaN( ray.Direction.X ) )
{
RayCastResult result = PhysicsWorld.Instance.RayCast( ray,
(int)ContactGroup.CastOnlyContact );
if( result.Shape != null )
{
pickingSuccess = true;
mouseOnObject = MapSystemWorld.GetMapObjectByBody( result.Shape.Body ) as Unit;
mouseMapPos = result.Position;
}
}
}
//pick on minimap
if( minimapControl.GetScreenRectangle().IsContainsPoint( MousePosition ) )
{
pickingSuccess = true;
Vec2 pos = GetMapPositionByMouseOnMinimap();
mouseMapPos = new Vec3( pos.X, pos.Y, GridPathFindSystem.Instance.GetMotionMapHeight( pos ) );
}
if( pickingSuccess )
{
//do tasks
if( TaskTargetChooseIndex != -1 )
{
if( button == EMouseButtons.Left )
DoTaskTargetChooseTasks( mouseMapPos, mouseOnObject );
if( button == EMouseButtons.Right )
TaskTargetChooseIndex = -1;
}
else
{
if( button == EMouseButtons.Right )
DoRightClickTasks( mouseMapPos, mouseOnObject );
}
}
}
//select mode
if( selectMode && button == EMouseButtons.Left )
DoEndSelectMode();
//minimap mouse change camera position
if( minimapChangeCameraPosition )
minimapChangeCameraPosition = false;
return base.OnMouseUp( button );
}
示例9: OnMouseDown
protected override bool OnMouseDown( EMouseButtons button )
{
//If atop openly any window to not process
if( Controls.Count != 1 )
return base.OnMouseDown( button );
switch( button )
{
case EMouseButtons.Left:
{
tryingToMovePiece = GetPieceByCursor();
if( tryingToMovePiece != null )
{
if( EntitySystemWorld.Instance.IsServer() )
{
//server
GameNetworkServer server = GameNetworkServer.Instance;
tryingToMovePiece.Server_MoveBegin( server.UserManagementService.ServerUser );
}
else if( EntitySystemWorld.Instance.IsClientOnly() )
{
//client
tryingToMovePiece.Client_MoveTryToBegin();
}
else
{
//single mode
tryingToMovePiece.Single_MoveBegin();
}
Vec2 cursorPosition;
GetGameAreaCursorPosition( out cursorPosition );
tryingToMovePieceOffset = tryingToMovePiece.Position.ToVec2() - cursorPosition;
return true;
}
}
break;
}
return base.OnMouseDown( button );
}
示例10: OnMouseUp
protected override bool OnMouseUp(EMouseButtons button)
{
//If atop openly any window to not process
if (Controls.Count != 1)
return base.OnMouseUp(button);
//GameControlsManager
GameControlsManager.Instance.DoMouseUp(button);
return base.OnMouseUp(button);
}
示例11: OnMouseDown
protected override bool OnMouseDown(EMouseButtons button)
{
if (demoMode)
{
Vec2 viewportSize = RendererWorld.Instance.DefaultViewport.DimensionsInPixels.Size.ToVec2();
Vec2 offset = 3.0f / viewportSize;
if (Math.Abs(MousePosition.X - screenTextLastMousePosition.X) > offset.X ||
Math.Abs(MousePosition.Y - screenTextLastMousePosition.Y) > offset.Y)
{
lastTimeOfKeyDownOrMouseMove = EngineApp.Instance.Time;
screenTextLastMousePosition = MousePosition;
}
}
return base.OnMouseDown(button);
}
示例12: DoMouseDown
/// <summary>
/// Sends the notice on pressing a mouse button.
/// </summary>
/// <param name="button">A value indicating which button was clicked.</param>
/// <returns><b>true</b> if such system key is used; otherwise, <b>false</b>.</returns>
public bool DoMouseDown(EMouseButtons button)
{
bool handled = false;
GameControlsManager.SystemKeyboardMouseValue key;
if (GameControlsManager.Instance.IsAlreadyBinded(button, out key))
{
if (GameControlsEvent != null)
GameControlsEvent(new GameControlsKeyDownEventData(key.Parent.ControlKey, 1));
handled = true;
}
return handled;
}
示例13: SystemKeyboardMouseValue
public SystemKeyboardMouseValue(EMouseButtons mouseButton, float strength)
{
type = Types.MouseButton;
this.mouseButton = mouseButton;
this.strength = strength;
}
示例14: IsAlreadyBinded
/// <summary>
/// Check if the Given Input is Binded. Return the currently binded control to the input
/// </summary>
public bool IsAlreadyBinded(EMouseButtons button, float strength, out SystemKeyboardMouseValue control)
{
control = null;
foreach (GameControlItem item in Items)
{
if (item.BindedKeyboardMouseValues.Count <= 0)
continue;
foreach (SystemKeyboardMouseValue value in item.BindedKeyboardMouseValues)
{
if (value.Type == SystemKeyboardMouseValue.Types.MouseButton &&
value.MouseButton == button && value.Strength == strength)
{
control = value;
return true;
}
}
}
return false;
}
示例15: OnMouseUp
protected override bool OnMouseUp( EMouseButtons button )
{
//If atop openly any window to not process
if( Controls.Count != 1 )
return base.OnMouseUp( button );
//currentAttachedGuiObject
if( currentAttachedGuiObject != null )
currentAttachedGuiObject.ControlManager.DoMouseUp( button );
//GameControlsManager
GameControlsManager.Instance.DoMouseUp( button );
return base.OnMouseUp( button );
}