Animation
Add
Bases: Animation
Represents an add animation.
Attributes:
Name | Type | Description |
---|---|---|
mode |
str
|
The mode of the animation. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the animation. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phobject |
Phobject
|
The phobject to add. |
required |
mode |
str
|
The mode of the animation. |
'smooth'
|
Source code in src/phanim/animate.py
AnimateValue
Bases: Animation
Represents an animation of a value.
Attributes:
Name | Type | Description |
---|---|---|
function |
function
|
The function to animate. |
target |
object
|
The target of the animation. |
duration |
int
|
The duration of the animation. |
currentFrame |
int
|
The current frame of the animation. |
animationMode |
str
|
The mode of the animation. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the animation. |
update |
Updates the animation. |
Source code in src/phanim/animate.py
Animation
Represents an animation of a phobject.
Attributes:
Name | Type | Description |
---|---|---|
object |
Phobject
|
The phobject being animated. |
position |
list
|
The position of the phobject. |
duration |
int
|
The duration of the animation. |
currentFrame |
int
|
The current frame of the animation. |
oldPhobject |
Phobject
|
A copy of the original phobject. |
animationMode |
str
|
The mode of the animation. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the animation. |
updateAndPrint |
Updates the animation and prints the current state. |
Source code in src/phanim/animate.py
updateAndPrint()
Updates the animation and prints the current state.
This method updates the animation based on the current frame and the animation mode. It then updates the object's attributes and prints the current state of the animation.
Returns:
Type | Description |
---|---|
None |
Source code in src/phanim/animate.py
Create
Bases: Animation
Represents a create animation.
Attributes:
Name | Type | Description |
---|---|---|
mode |
str
|
The mode of the create animation. |
Methods:
Name | Description |
---|---|
update |
Updates the create animation. |
Source code in src/phanim/animate.py
Destroy
Bases: Animation
Represents a destroy animation.
Attributes:
Name | Type | Description |
---|---|---|
mode |
str
|
The mode of the destroy animation. |
Methods:
Name | Description |
---|---|
update |
Updates the destroy animation. |
Source code in src/phanim/animate.py
Move
Bases: Animation
Represents a move animation.
Attributes:
Name | Type | Description |
---|---|---|
object |
Phobject
|
The phobject to move. |
Methods:
Name | Description |
---|---|
update |
Updates the move animation. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phobject |
Phobject
|
The phobject to move. |
required |
Source code in src/phanim/animate.py
Remove
Bases: Animation
Represents a remove animation.
Attributes:
Name | Type | Description |
---|---|---|
mode |
str
|
The mode of the animation. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the animation. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phobject |
Phobject
|
The phobject to remove. |
required |
mode |
str
|
The mode of the animation. |
'smooth'
|
Source code in src/phanim/animate.py
Shift
Bases: Move
Represents a shift animation.
Methods:
Name | Description |
---|---|
update |
Updates the shift animation. |
Source code in src/phanim/animate.py
Sleep
Bases: Animation
Represents a sleep animation.
Attributes:
Name | Type | Description |
---|---|---|
duration |
int
|
The duration of the sleep animation. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the sleep animation. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration |
int
|
The duration of the sleep animation. |
required |
Source code in src/phanim/animate.py
Transform
Bases: Animation
Represents a transformation animation.
Attributes:
Name | Type | Description |
---|---|---|
newPhobject |
Phobject
|
The new phobject to transform into. |
duration |
int
|
The duration of the animation. |
mode |
str
|
The mode of the animation. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the animation. |
update |
Updates the animation. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phobject |
Phobject
|
The phobject to transform. |
required |
newPhobject |
Phobject
|
The new phobject to transform into. |
required |
duration |
int
|
The duration of the animation. |
60
|
mode |
str
|
The mode of the animation. |
'smooth'
|
Source code in src/phanim/animate.py
laggedStart
Represents a lagged start animation.
Attributes:
Name | Type | Description |
---|---|---|
animations |
list
|
The list of animations. |
playingAnimations |
list
|
The list of playing animations. |
currentFrame |
int
|
The current frame of the animation. |
lagRatio |
float
|
The lag ratio of the animation. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the animation. |
updateAndPrint |
Updates the animation and prints the current state. |
__setDuration |
Sets the duration of the animation. |