added a sample yaml animations definition
This commit is contained in:
parent
9db52065d9
commit
3b339846ca
1 changed files with 64 additions and 0 deletions
64
rpi/animations.yaml
Normal file
64
rpi/animations.yaml
Normal file
|
@ -0,0 +1,64 @@
|
|||
# This is an example animation definition yaml file
|
||||
|
||||
animations:
|
||||
- name: Animation1
|
||||
description: This is the first animation
|
||||
loop_count: 1 # Number of loops (1 for single play, 0 for infinite)
|
||||
|
||||
# Define the trigger for this animation.
|
||||
# In this case, it triggers when a button is pressed.
|
||||
trigger: button_press
|
||||
|
||||
# Specify whether this animation can be overridden by another animation.
|
||||
overrideable: true
|
||||
|
||||
graphics:
|
||||
- type: transition
|
||||
from: current # A keyvalue describing the current state
|
||||
to: animation1_frame1.png # Specify the new PNG image for the transition
|
||||
duration: 10 # The amount of frames the transition will take.
|
||||
|
||||
- type: image
|
||||
source: animation1_frame1.png
|
||||
duration: 10 # The amount of frames the image will be shown.
|
||||
# This is the initial frame of the animation.
|
||||
|
||||
- type: transition
|
||||
from: animation1_frame1.png
|
||||
to: animation1_frame2.png
|
||||
duration: 10 # The amount of frames the transition will take.
|
||||
# This is a transition from the initial frame to the next frame.
|
||||
# Transitions can be used to create smooth animations.
|
||||
|
||||
- type: animation
|
||||
source: animation1.gif
|
||||
# This is an animated GIF that plays as part of the animation.
|
||||
# It can add dynamic elements to the animation.
|
||||
|
||||
# You can add more graphics elements as needed for this animation.
|
||||
|
||||
# Additional comments or configuration options for Animation1 can go here.
|
||||
# For example, you can specify the duration, sound effects, or other details.
|
||||
|
||||
- name: blink
|
||||
description: Animation for blinking
|
||||
loop_count: 1
|
||||
|
||||
trigger: idle_timer
|
||||
|
||||
overrideable: true # blink can be interupted at any time
|
||||
|
||||
graphics:
|
||||
- type: transition # close the eye from whatever the current state
|
||||
from: current
|
||||
to: eyesClosed_neutral.png
|
||||
duration: 10
|
||||
|
||||
- type: image # hold eye closed
|
||||
source: eyesClosed_neutral.png
|
||||
duration: 20
|
||||
|
||||
- type: transition # open the eye again from being closed
|
||||
from: eyesClosed_neutral.png
|
||||
to: neutral.png
|
||||
duration: 10
|
Loading…
Reference in a new issue