public class GAnimIcon extends GIcon
| Constructor and Description |
|---|
GAnimIcon(processing.core.PApplet papp,
processing.core.PImage image,
int nbrCols,
int nbrRows,
int interval)
Create an animated icon
|
GAnimIcon(processing.core.PApplet papp,
java.lang.String fname,
int nbrCols,
int nbrRows,
int interval)
Create an animated icon
|
| Modifier and Type | Method and Description |
|---|---|
void |
advanceAnimationFrame(GTimer timer) |
GAnimIcon |
animate()
Animate the entire sequence.
|
GAnimIcon |
animate(java.lang.String id)
Animate the icon using store clip details but use the specified
frame interval instead of the stored value.
|
GAnimIcon |
copy()
Returns a copy of this animated icon to be used with another control.
|
GAnimIcon |
setFrame(int fn)
Set the current frame to be displayed.
|
GAnimIcon |
setInterval(int interval)
Change the interval between frames for the current animation clip.
|
GAnimIcon |
setInterval(java.lang.String id,
int interval)
Change the interval between frames for the animation clip with
specified id.
|
GAnimIcon |
start()
Resume an animation that has previously been stopped with stop()
|
GAnimIcon |
stop()
Stop the current animation.
|
GAnimIcon |
storeAnim(java.lang.String id,
int start,
int end,
int interval)
Store details of an animation sequence for later use.
|
GAnimIcon |
storeAnim(java.lang.String id,
int start,
int end,
int interval,
int nbrLoops)
Store details of an animation sequence for later use.
|
public GAnimIcon(processing.core.PApplet papp,
java.lang.String fname,
int nbrCols,
int nbrRows,
int interval)
papp - the PApplet object that will be used to display this iconfname - the name of the file containing the tiled image.nbrCols - number of horizontal tilesnbrRows - number of vertical tilesinterval - the time between displaying frames in millisecondspublic GAnimIcon(processing.core.PApplet papp,
processing.core.PImage image,
int nbrCols,
int nbrRows,
int interval)
papp - the PApplet object that will be used to display this iconimage - the tiled image containing the framesnbrCols - number of horizontal tilesnbrRows - number of vertical tilesinterval - the time between displaying frames in millisecondspublic GAnimIcon copy()
public GAnimIcon storeAnim(java.lang.String id, int start, int end, int interval)
id - unique id for this animation clipstart - first frame for this clipend - last frame for this clipinterval - the time (ms) between framespublic GAnimIcon storeAnim(java.lang.String id, int start, int end, int interval, int nbrLoops)
id - unique id for this animation clipstart - first frame for this clipend - last frame for this clipinterval - the time (ms) between framesnbrLoops - the number of times this clip is played, (0 = play forever)public GAnimIcon animate()
public GAnimIcon animate(java.lang.String id)
id - the unique id for the clipframeInterval - the time between framesnbrLoops - the number of times the clip is to be shown (<=0 will repeat the clip for ever).public GAnimIcon setInterval(int interval)
interval - the time between frames in millisecondspublic GAnimIcon setInterval(java.lang.String id, int interval)
interval - the time between frames in millisecondspublic GAnimIcon start()
public GAnimIcon stop()
public GAnimIcon setFrame(int fn)
fn - the frame number to display.public void advanceAnimationFrame(GTimer timer)
Processing library G4P by Peter Lager. (c) 2017