tkintertools.animation.controllers¶
字数 215 个 代码 25 行 阅读时间 1 分钟 访问量
Standard control functions
Definition of control function:
- t: 0% ~ 100%, indicates the percentage of time
- return value: Any real number, represents a multiple of the cardinality of the animation
The built-in control functions are:
flat
: speed remains the samesmooth
: speed is slow first, then fast and then slowrebound
: before the end, displacement will bounce off a bit
🔵_map_t
¶
function
protected
Map parameters in any range between 0 and 1
start
: the first value of the parameter of control functionend
: the last value of the parameter of control function
🔵_map_y
¶
function
protected
Map the final return value to 1
base_function
: base functionend
: the last value of the parameter of control function
🔵controller_generator
¶
function
public
Generator of control functions
Modify the generic function to a control function suitable for animation
base_function
: base functionstart
: the first value of the parameter of control functionend
: the last value of the parameter of control functionmap_y
: whether map the final return value to 1
For example:
- Before modifying: \(y = 2\sint, 0 <= t <= \pi/2\)
- After modifying: \(y = \sin\frac{\pi}{2}t, 0 <= t <= 1\)
🔵flat
¶
function
public
🔵rebound
¶
function
public
🔵smooth
¶
function
public