InteractionTracker.TryUpdateScale(Single, Vector3) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to update the scale to the specified value.
The TryUpdateScale method updates the scale location of InteractionTracker to the Scale position and centerpoint specified as a parameter. TryUpdateScale is used to declaratively define the scale of InteractionTracker at any point in time (either at start, from some state-entered event, etc.). TryUpdateScale can be called from either the Idle, CustomAnimation or Inertia state – doing so will move the scale position of InteractionTracker to the defined position and enter the idle state.
public:
virtual int TryUpdateScale(float value, float3 centerPoint) = TryUpdateScale;
int TryUpdateScale(float const& value, float3 const& centerPoint);
public int TryUpdateScale(float value, Vector3 centerPoint);
function tryUpdateScale(value, centerPoint)
Public Function TryUpdateScale (value As Single, centerPoint As Vector3) As Integer
Parameters
- value
-
Single
float
The new value for scale.
Returns
int
Returns the request ID. On state transitions, the request which caused the change in state will be included in the args. These IDs will start at 1 and increase with each try call during the lifetime of the application.
Examples
void SetupInteractionTracker()
{
// Setup InteractionTracker
_tracker = InteractionTracker.Create(_compositor);
_interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
_interactionSource.PositionYSourceMode = InteractionSourceMode.EnabledWithInertia;
_tracker.InteractionSources.Add(_interactionSource);
_tracker.PositionInertiaDecayRate = new Vector3(0.95f);
// Update the scale position of InteractionTracker
_tracker.TryUpdateScale(0.5f, new Vector3(50f));
}
Remarks
If InteractionTracker is in its Interacting State (user actively manipulating), and TryUpdateScale is called, the system will ignore this request – an event gets fired when this occurs that can be listened for. If sent from one of the other states, listen for the event fired for IdleStateEntered and check the RequestID property that identifies which request triggered the callback.
The table below summarizes the expected behavior when this method is called in a particular state:
Current State | Outcome |
---|---|
Idle | Property updates to requested value, no state changes |
Interacting | Request ignored |
Inertia | Property updates to requested value, state changes to Idle |
CustomAnimation | Property updates to requested value, state changes to Idle |