maliang.animation.animations¶
字数 834 个 代码 132 行 阅读时间 4 分钟 访问量
源代码:maliang/animation/animations.py
Base and standard animation classes.
The animation base class can be inherited or called directly. Other standard animation classes are best used by direct calls, rather than inheritance.
🟢Animation
¶
class
public
| object
Base animation class.
duration
: duration of the animation, in millisecondscommand
: callback function, which will be called once per framecontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeatsderivation
: whether the callback function is derivative
🟡_repeat
¶
method
protected
🟡skip
¶
method
public
count
: count of skipping
🟡start
¶
method
public
delay
: length of the delay before the animation starts
🟡stop
¶
method
public
delay
: length of the delay before the animation stops
🟢GradientItem
¶
class
public
| Animation
Animation of making the color of canvas item to be gradient.
canvas
: an instance oftkinter.Canvas
that contains the itemitem
: item whose color is to be gradientparameter
: parameter name of item that is to be modified in colorcolors
: a tuple of the initial and ending colorsduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeatsderivation
: whether the callback function is derivative
🟢GradientTkWidget
¶
class
public
| Animation
Animation of making the color of
tkinter.Widget
to be gradient. widget
: thetkinter.Widget
whose color is to be gradientparameter
: parameter name of widget that is to be modified in colorcolors
: a tuple of the initial and ending colorsduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeatsderivation
: whether the callback function is derivative
🟢MoveElement
¶
class
public
| Animation
virtual.Element
. element
: thevirtual.Element
to be movedoffset
: relative offset of the coordinatesduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeats
🟢MoveItem
¶
class
public
| Animation
Animation of moving a item of
tkinter.Canvas
. canvas
: an instance oftkinter.Canvas
that contains the itemitem
: the item to be movedoffset
: relative offset of the coordinatesduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeats
🟢MoveTkWidget
¶
class
public
| Animation
tkinter.Widget
. widget
: thetkinter.Widget
to be movedoffset
: relative offset of the coordinatesduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeats
🟢MoveWidget
¶
class
public
| Animation
virtual.Widget
. widget
: thevirtual.Widget
to be movedoffset
: relative offset of the coordinatesduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeats
🟢MoveWindow
¶
class
public
| Animation
Animation of moving the window.
window
: the window to be movedoffset
: relative offset of the coordinatesduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeats
🟢ScaleFontSize
¶
class
public
| Animation
Animation of scaling the font size of
virtual.Text
. text
: an instance ofvirtual.Text
that needs to be scaledsizes
: a tuple of the initial and ending sizes or target font sizeduration
: duration of the animation, in millisecondscontroller
: a function that controls the animation processend
: end function, which is called once at the end of the animationfps
: frame rate of the animationrepeat
: number of repetitions of the animationrepeat_delay
: length of the delay before the animation repeatsderivation
: whether the callback function is derivative