InteractionTracker.ScaleVelocityInPercentPerSecond Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Tingkat perubahan untuk skala.
Properti ScaleVelocityInPercentPerSecond mewakili kecepatan skala InteractionTracker saat ini di Inertia. Mengambil kecepatan posisi InteractionTracker tepat setelah Interaksi terjadi atau mereferensikan kecepatan InteractionTracker terbaru dalam ExpressionAnimation.
public:
property float ScaleVelocityInPercentPerSecond { float get(); };
float ScaleVelocityInPercentPerSecond();
public float ScaleVelocityInPercentPerSecond { get; }
var single = interactionTracker.scaleVelocityInPercentPerSecond;
Public ReadOnly Property ScaleVelocityInPercentPerSecond As Single
Nilai Properti
float
Tingkat perubahan untuk skala.
Contoh
// Listen for the InertiaStateEntered event
public void InertiaStateEntered(InteractionTracker sender, InteractionTrackerInertiaStateEnteredArgs args)
{
// Grab the Scale velocity out of the args when the event is fired.
float scaleVelocity = args.ScaleVelocityInPercentPerSecond;
}
void CustomSpringMotion(float springCoefficient, float dampingCoefficient, float maxScale)
{
// Create the InertiaModifier that will be a custom motion emulating a spring
InteractionTrackerInertiaMotion modifier = InteractionTrackerInertiaMotion.Create(_compositor);
modifier.Condition = _compositor.CreateExpressionAnimation("this.Target.NaturalRestingPosition.X > maxScale");
modifier.Condition.SetScalarParameter("maxScale", maxScale);
// Utilize the current Velocity of InteractionTracker in the Expression defining the custom spring motion
modifier.Motion = _compositor.CreateExpressionAnimation("(-springStiffnessCoefficient * (this.Target.Position.X – maxScale)) + " +
"(-dampingCoefficient * this.target.ScaleVelocityInPercentPerSecond");
modifier.Motion.SetScalarParameter("springStiffnessCoefficient", springCoefficient);
modifier.Motion.SetScalarParameter("dampingCoefficient", dampingCoefficient);
modifier.Motion.SetScalarParameter("maxScale", maxScale);
}
Keterangan
Saat mengakses properti ScaleVelocityInPercentPerSecond dari peristiwa InertiaStateEntered , Anda akan mengambil rekam jepret dari kecepatan terhitung berdasarkan Interaksi. Kejadian ini hanya akan diaktifkan sekali setelah interaksi terjadi.