public void OnEmulatorButtonEvent(Microsoft.Xna.Framework.Input.Touch.TouchLocation touch, float touchX, float touchY) { if (!visible) { return; } switch (touch.State) { case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Pressed: offsetTouchX = touchX; offsetTouchY = touchY; Hit(touch.Id, touchX, touchY, false); break; case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Released: Unhit(touch.Id, touchX, touchY); break; case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Moved: offsetMoveX = touchX; offsetMoveY = touchY; if (MathUtils.Abs(offsetTouchX - offsetMoveX) > 5 || MathUtils.Abs(offsetTouchY - offsetMoveY) > 5) { Hit(touch.Id, touchX, touchY, true); } break; case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Invalid: Unhit(touch.Id, touchX, touchY); break; } }
/// <summary> /// 当触发模拟按钮时,自动分配事件 /// </summary> /// <param name="touch"></param> /// <param name="touchX"></param> /// <param name="touchY"></param> public void OnEmulatorButtonEvent(Microsoft.Xna.Framework.Input.Touch.TouchLocation touch, float touchX, float touchY) { if (!visible) { return; } switch (touch.State) { case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Pressed: Hit(touch.Id, touchX, touchY); break; case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Released: Unhit(touch.Id); break; case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Moved: Hit(touch.Id, touchX, touchY); break; case Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Invalid: Unhit(touch.Id); break; } }
public override void OnTouchDown(Microsoft.Xna.Framework.Input.Touch.TouchLocation state) { this.Focus(); base.OnTouchDown(state); SetCursorIndexByPosition(state.Position); }
public override void OnTouchMove(Microsoft.Xna.Framework.Input.Touch.TouchLocation state) { base.OnTouchMove(state); if (IsFocused && state.State == Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Moved) { SetCursorIndexByPosition(state.Position); } }
public override void OnTouchMove(Microsoft.Xna.Framework.Input.Touch.TouchLocation state) { base.OnTouchMove(state); if (moving) { var x = state.Position.X - startPosX; this.Value = (x / factor) + startValue; } }
public override void OnTouchDown(Microsoft.Xna.Framework.Input.Touch.TouchLocation state) { base.OnTouchDown(state); if (cmdTrack.IsTouchDown) { startPosX = state.Position.X; startValue = this.Value; moving = true; } }
void p_OnPickedGesture(SegmentInterceptInfo SegmentInterceptInfo, Microsoft.Xna.Framework.Input.Touch.TouchLocation TouchLocation) { destiny = VectorUtils.ToVector2(SegmentInterceptInfo.ImpactPosition); for (int i = 0; i < Simulator.getNumAgents(); i++) { Vector2 rvopos = Simulator.getAgentPosition(i); Vector2 agentpos = new Vector2(rvopos.X, rvopos.Y); Vector2 vv = Vector2.Normalize(destiny - agentpos); Vector2 v = new Vector2(vv.X, vv.Y); Simulator.setAgentPrefVelocity(i, v); } }
private void ProcessTouch() { var touches = Input.touch.currentTouches; foreach (var touch in touches) { var previousLocation = new Microsoft.Xna.Framework.Input.Touch.TouchLocation(); if (!touch.TryGetPreviousLocation(out previousLocation)) { position = touch.scaledPosition(); Android.Util.Log.Info("Player", "ID: " + touch.Id.ToString() + "Position: " + position.X.ToString() + " , " + position.Y.ToString()); ProcessCollision(); } } }
void pick_OnPickedGesture(SegmentInterceptInfo SegmentInterceptInfo, Microsoft.Xna.Framework.Input.Touch.TouchLocation TouchLocation) { result = "Position " + SegmentInterceptInfo.ImpactPosition + " - " + SegmentInterceptInfo.PhysicObject.ObjectOwner.Name; }
//-------------------------------------------------------------------------------------- /// <summary> /// VarmintWidgetTextInput_OnTouchDown /// </summary> //-------------------------------------------------------------------------------------- private EventHandledState VarmintWidgetTextInput_OnTouchDown(VarmintWidget arg1, Microsoft.Xna.Framework.Input.Touch.TouchLocation arg2) { return(EventHandledState.Handled); }
public override void OnTouchUp(Microsoft.Xna.Framework.Input.Touch.TouchLocation state) { base.OnTouchUp(state); moving = false; }
public bool Equals(Microsoft.Xna.Framework.Input.Touch.TouchLocation touchLocation) { throw new NotImplementedException(); }