Partilhar via


Cue.GetVariable Method

Gets a cue-instance variable value based on its friendly name.

Syntax

'Declaration
Public Function GetVariable ( _
         name As String _
) As Single 
public float GetVariable (
         string name
)
public:
float GetVariable(
         String name
)

Parameters

  • name
    Type: String
    Friendly name of the variable.

Return Value

Type: Single
Value of the variable.

Remarks

Cue-instance variables are useful when multiple instantiations of a single cue (and its associated sounds) are required (for example, a "car" cue where there may be more than one car at any given time). While a global variable allows multiple audio elements to be controlled in unison, a cue instance variable grants discrete control of each instance of a cue, even for each copy of the same cue.

The friendly name is a text string that the designer can associate with the cue when it is built.

Exceptions

Exception type Condition
ArgumentNullException The name parameter is null.

Requirements

Namespace: Microsoft.Xna.Framework.Audio

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

See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Platforms

Windows Phone