tkintertools.animation.animations¶
字数 717 个 代码 111 行 阅读时间 4 分钟 访问量
Standard animation classes
The built-in basic animation classes are: MoveTkWidget
, MoveWidget
, MoveComponent
, MoveItem
, GradientTkWidget
, GradientItem
, ScaleFontSize
🟢Animation
¶
class
public
| object
ms
: duration of the animation, in millisecondscontroller
: control functions that determine the course of the entire animation movementcallback
: callback function, which will be called once per frame, with the parameter being the percentage of the current animation progressend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animationderivation
: whether the callback function is derivative
🟡_wrapper
¶
method
protected
Make the ending function call correctly
func
: the callback function to be wrapped
🟡start
¶
method
public
Start the animation
delay
: length of the delay before the animation starts, in milliseconds
🟡stop
¶
method
public
🟢GradientItem
¶
class
public
| Animation
canvas
: an instance oftkinter.Canvas
that contains the itemitem
: item whose color is to be gradientparameter
: parameter name of the part of the item that needs to be modified in colorms
: duration of the animation, in millisecondscolors
: a tuple of the initial and ending colorscontroller
: control functions that determine the course of the entire animation movementend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animationderivation
: whether the callback function is derivative
🟢GradientTkWidget
¶
class
public
| Animation
tkinter.Widget
gradient widget
: tkinter widget whose color is to be gradientparameter
: parameter name of the part of the item that needs to be modified in colorms
: duration of the animation, in millisecondscolors
: a tuple of the initial and ending colorscontroller
: control functions that determine the course of the entire animation movementend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animationderivation
: whether the callback function is derivative
🟢MoveComponent
¶
class
public
| Animation
Component
component
: component to be movedms
: duration of the animation, in millisecondsoffset
: relative offset of the coordinatescontroller
: control functions that determine the course of the entire animation movementend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animation
🟢MoveItem
¶
class
public
| Animation
canvas
: an instance oftkinter.Canvas
that contains the itemitem
: the item to be movedms
: duration of the animation, in millisecondsoffset
: relative offset of the coordinatescontroller
: control functions that determine the course of the entire animation movementend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animation
🟢MoveTkWidget
¶
class
public
| Animation
tkinter.Widget
widget
: tkinter widget to be movedms
: duration of the animation, in millisecondsoffset
: relative offset of the coordinatescontroller
: control functions that determine the course of the entire animation movementend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animation
🟢MoveWidget
¶
class
public
| Animation
Widget
widget
: widget to be movedms
: duration of the animation, in millisecondsoffset
: relative offset of the coordinatescontroller
: control functions that determine the course of the entire animation movementend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animation
🟢ScaleFontSize
¶
class
public
| Animation
text
: an instance ofvirtual.Text
that needs to be scaled in font sizems
: duration of the animation, in millisecondssizes
: a tuple of the initial and ending sizes or target font sizecontroller
: control functions that determine the course of the entire animation movementend
: ending function, which is called once at the end of the animationrepeat
: number of repetitions of the entire animation processfps
: the FPS of the animationderivation
: whether the callback function is derivative
🟡_scale
¶
method
protected