Click to Rate and Give Feedback
MSDN
MSDN Library
XNA Game Studio
XNA Game Studio 3.1
GamePad Class
GamePad Methods
 SetVibration Method

  Switch on low bandwidth view
XNA Game Studio 3.1
GamePad.SetVibration Method
Sets the vibration motor speeds on an Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

C#
public static bool SetVibration (
         PlayerIndex playerIndex,
         float leftMotor,
         float rightMotor
)

Parameters

playerIndex
Player index that identifies the controller to set.
leftMotor
The speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotor
The speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.

Return Value

true if the vibration motors were successfully set; false if the controller was unable to process the request.
Exception typeCondition
InvalidOperationException An unknown error has occurred. Verify that the correct playerIndex is being requested.

If this method returns false, it means that the controller is either disconnected or too busy to accept the new vibration settings. It is not advisable to loop in wait for this method to return true.

Xbox 360, Windows XP SP2, Windows Vista, Zune
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker