Animated Images: end_frame, frame_skips, image_templates #411
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds new functionality for animated images!
Image widget
end_frame
The new
end_frame
property of images can be used to animate an image to a certain frame and then hold the animation. It can be used with the standard imageanimations
configuration, and supports placeholder values.Image Asset
frame_skips
Image assets can include a list of frames to skip, and when the image animation is running the selected frames will be skipped unless the image has an end_frame inside the skip bounds. This allows more customization of animated sprites transitioning between animations, and for virtual score reels allows a nice "bounce" animation on the arrival of a number but skips the bounce when rolling past numbers.
In this example, the animating image will skip frames 3-9, 12-18, and 21-27 when it plays. Unless the image was animating to end_frame 6, in which case it would skip 12-18 and 21-27 but play through from 2 to 6.
Image Asset
image_templates
This new configuration option allows Image configurations to be re-used for multiple image assets. This is valuable for defining multiple assets from an identical image without having to re-type a lot of verbose config code (especially frame skips).
For reasons related to asset management startup, the
file
property is not supported in the template and must be provided in the asset definition itself. Overcoming this requires much more code than it's worth 😛