private void OnTouch(object sender, SKTouchEventArgs e) { var pos = e.Location; var x = (pos.X - offset.X) / scale; var y = (pos.Y - offset.Y) / scale; if (e.ActionType == SKTouchAction.Pressed) { game.TouchDown(new SKPointI((int)x, (int)y)); } else if (e.ActionType == SKTouchAction.Released) { game.TouchUp(new SKPointI((int)x, (int)y)); game.Tap(new SKPointI((int)x, (int)y)); } e.Handled = true; }
private void OnTouch(object sender, SKTouchEventArgs e) { var pos = e.Location; var x = pos.X; // / gameSurface.CanvasSize.Width * baseSize.Width; var y = pos.Y; // / gameSurface.CanvasSize.Height * baseSize.Height; if (e.ActionType == SKTouchAction.Pressed) { game.TouchDown(new SKPointI((int)x, (int)y)); } else if (e.ActionType == SKTouchAction.Released) { game.TouchUp(new SKPointI((int)x, (int)y)); game.Tap(new SKPointI((int)x, (int)y)); } e.Handled = true; }