interpolateValueAction.d.ts 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Action } from "./action";
  2. import type { Condition } from "./condition";
  3. import { Observable } from "../Misc/observable";
  4. /**
  5. * This defines an action responsible to change the value of a property
  6. * by interpolating between its current value and the newly set one once triggered.
  7. * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
  8. */
  9. export declare class InterpolateValueAction extends Action {
  10. /**
  11. * Defines the path of the property where the value should be interpolated
  12. */
  13. propertyPath: string;
  14. /**
  15. * Defines the target value at the end of the interpolation.
  16. */
  17. value: any;
  18. /**
  19. * Defines the time it will take for the property to interpolate to the value.
  20. */
  21. duration: number;
  22. /**
  23. * Defines if the other scene animations should be stopped when the action has been triggered
  24. */
  25. stopOtherAnimations?: boolean;
  26. /**
  27. * Defines a callback raised once the interpolation animation has been done.
  28. */
  29. onInterpolationDone?: () => void;
  30. /**
  31. * Observable triggered once the interpolation animation has been done.
  32. */
  33. onInterpolationDoneObservable: Observable<InterpolateValueAction>;
  34. private _target;
  35. private _effectiveTarget;
  36. private _property;
  37. /**
  38. * Instantiate the action
  39. * @param triggerOptions defines the trigger options
  40. * @param target defines the object containing the value to interpolate
  41. * @param propertyPath defines the path to the property in the target object
  42. * @param value defines the target value at the end of the interpolation
  43. * @param duration defines the time it will take for the property to interpolate to the value.
  44. * @param condition defines the trigger related conditions
  45. * @param stopOtherAnimations defines if the other scene animations should be stopped when the action has been triggered
  46. * @param onInterpolationDone defines a callback raised once the interpolation animation has been done
  47. */
  48. constructor(triggerOptions: any, target: any, propertyPath: string, value: any, duration?: number, condition?: Condition, stopOtherAnimations?: boolean, onInterpolationDone?: () => void);
  49. /** @internal */
  50. _prepare(): void;
  51. /**
  52. * Execute the action starts the value interpolation.
  53. */
  54. execute(): void;
  55. /**
  56. * Serializes the actions and its related information.
  57. * @param parent defines the object to serialize in
  58. * @returns the serialized object
  59. */
  60. serialize(parent: any): any;
  61. }