File size: 3,272 Bytes
dc00adb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | # ValueTracker
Qualified name: `manim.mobject.value\_tracker.ValueTracker`
### *class* ValueTracker(value=0, \*\*kwargs)
Bases: [`Mobject`](manim.mobject.mobject.Mobject.md#manim.mobject.mobject.Mobject)
A mobject that can be used for tracking (real-valued) parameters.
Useful for animating parameter changes.
Not meant to be displayed. Instead the position encodes some
number, often one which another animation or continual_animation
uses for its update function, and by treating it as a mobject it can
still be animated and manipulated just like anything else.
This value changes continuously when animated using the `animate` syntax.
### Examples
#### NOTE
You can also link ValueTrackers to updaters. In this case, you have to make sure that the
ValueTracker is added to the scene by `add`
### Methods
| [`get_value`](#manim.mobject.value_tracker.ValueTracker.get_value) | Get the current value of this ValueTracker. |
|--------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [`increment_value`](#manim.mobject.value_tracker.ValueTracker.increment_value) | Increments (adds) a scalar value to the ValueTracker. |
| [`interpolate`](#manim.mobject.value_tracker.ValueTracker.interpolate) | Turns `self` into an interpolation between `mobject1` and `mobject2`. |
| [`set_value`](#manim.mobject.value_tracker.ValueTracker.set_value) | Sets a new scalar value to the ValueTracker. |
### Attributes
| `animate` | Used to animate the application of any method of `self`. |
|-----------------------|------------------------------------------------------------|
| `animation_overrides` | |
| `depth` | The depth of the mobject. |
| `height` | The height of the mobject. |
| `width` | The width of the mobject. |
* **Parameters:**
* **value** (*float*)
* **kwargs** (*Any*)
#### \_original_\_init_\_(value=0, \*\*kwargs)
Initialize self. See help(type(self)) for accurate signature.
* **Parameters:**
* **value** (*float*)
* **kwargs** (*Any*)
* **Return type:**
None
#### get_value()
Get the current value of this ValueTracker.
* **Return type:**
float
#### increment_value(d_value)
Increments (adds) a scalar value to the ValueTracker.
* **Parameters:**
**d_value** (*float*)
* **Return type:**
Self
#### interpolate(mobject1, mobject2, alpha, path_func=<function interpolate>)
Turns `self` into an interpolation between `mobject1` and `mobject2`.
* **Parameters:**
* **mobject1** ([*Mobject*](manim.mobject.mobject.Mobject.md#manim.mobject.mobject.Mobject))
* **mobject2** ([*Mobject*](manim.mobject.mobject.Mobject.md#manim.mobject.mobject.Mobject))
* **alpha** (*float*)
* **path_func** ([*PathFuncType*](manim.typing.md#manim.typing.PathFuncType))
* **Return type:**
Self
#### set_value(value)
Sets a new scalar value to the ValueTracker.
* **Parameters:**
**value** (*float*)
* **Return type:**
Self
|