java.lang.Object | ||
↳ | net.pierrox.lightning_launcher.script.api.Image | |
↳ | net.pierrox.lightning_launcher.script.api.ImageAnimation |
A kind of image which can play an animation (often loaded from GIF files). Note: as of today backgrounds and icon layers do not support animations, only the first frame will be displayed.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnimationDecoder | getDecoder() | ||||||||||
int |
getFrameCount()
Return the number of frames in this animation.
| ||||||||||
int |
getFrameDuration(int index)
Return the delay for the frame at a given index
| ||||||||||
ImageBitmap |
getFrameImage(int index)
Return the image at a given index.
| ||||||||||
int |
getHeight()
Return the image height
| ||||||||||
int |
getLoopCount()
Return the maximal number of loop set (can be modified with #start).
| ||||||||||
int |
getTotalDuration()
Return the sum of all frames duration.
| ||||||||||
int |
getWidth()
Return the image width
| ||||||||||
boolean |
isPlaying()
Return true when the animation is playing.
| ||||||||||
boolean |
saveToFile(String path)
Save the animation to file using the GIF format.
| ||||||||||
void |
setFrameCount(int count)
Change the number of frames for this animation.
| ||||||||||
void |
setFrameDuration(int index, int delay)
Set the duration for a frame, in milliseconds.
| ||||||||||
void |
setLoopCount(int count)
Set the maximum number of times to play the animation.
| ||||||||||
void |
start()
Start (or restart) the animation.
| ||||||||||
void |
stop()
Stop the animation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
net.pierrox.lightning_launcher.script.api.Image
| |||||||||||
From class
java.lang.Object
|
Return the number of frames in this animation.
Return the delay for the frame at a given index
Return the image height
Return the maximal number of loop set (can be modified with #start).
Return the sum of all frames duration.
Return the image width
Return true when the animation is playing.
Save the animation to file using the GIF format. Animated GIFs support a maximum of 256 colors and no transluceny (only binary tranparency): saved animations may appear differently when reloaded. This is an experimental and sub-optimal feature.
path | where to store the file |
---|
Change the number of frames for this animation. When increasing the number of frames, existing frames are kept while new one are created fully transparent, with a default delay of 100ms. Decreasing the number of frames will also keep frames whose index is below the count, other will be freed. Warning: this will ensure that count images are allocated, this is a costly operation.
count | number of frames |
---|
Set the duration for a frame, in milliseconds.
Set the maximum number of times to play the animation.
count | number of loops to play, use 0 for infinite |
---|
Start (or restart) the animation.
Stop the animation.