G4P (GUI for Processing)  4.3.8
A set of GUI controls for your Processing sketch.
 All Classes Functions Variables Pages
g4p_controls.GAnimIcon Class Reference
Inheritance diagram for g4p_controls.GAnimIcon:

Classes

class  AnimClip
 

Public Member Functions

void advanceAnimationFrame (GTimer timer)
 
GAnimIcon animate ()
 
GAnimIcon animate (String id)
 
GAnimIcon copy ()
 
 GAnimIcon (PApplet papp, String fname, int nbrCols, int nbrRows, int interval)
 
 GAnimIcon (PApplet papp, PImage image, int nbrCols, int nbrRows, int interval)
 
GAnimIcon getThis ()
 
void listClips (String title)
 
GAnimIcon setFrame (int fn)
 
GAnimIcon setInterval (int interval)
 
GAnimIcon setInterval (String id, int interval)
 
GAnimIcon start ()
 
GAnimIcon stop ()
 
GAnimIcon storeAnim (String id, int start, int end, int interval)
 
GAnimIcon storeAnim (String id, int start, int end, int interval, int nbrLoops)
 
- Public Member Functions inherited from g4p_controls.GIcon
GIcon copy ()
 
PImage getFrame (int fn)
 
PImage getFrame ()
 
GIcon getThis ()
 
 GIcon (PApplet papp, String fname, int nbrCols, int nbrRows)
 
 GIcon (PApplet papp, PImage image, int nbrCols, int nbrRows)
 
int height ()
 
int width ()
 

Protected Member Functions

 GAnimIcon ()
 
- Protected Member Functions inherited from g4p_controls.GIcon
 GIcon ()
 

Protected Attributes

AnimClip anim_clip = null
 
Map< String, AnimClipclips = new HashMap<String, AnimClip>()
 
GTimer timer
 
- Protected Attributes inherited from g4p_controls.GIcon
PApplet app = null
 
int currFrame = 0
 
int height = 0
 
PImage[] img = null
 
int nbrFrames = 0
 
GAbstractControl owner = null
 
int width = 0
 

Detailed Description

Class for the creation of animated icons to be used with GButton, GLabel, GCheckbox and GOption controls.

All animated icons will have an animation clip called 'ALL' which displays all the frames starting at zero with the user specified frame interval.

Introduced in v4.1

Author
Peter Lager

Constructor & Destructor Documentation

g4p_controls.GAnimIcon.GAnimIcon ( )
protected

This constructor is not to be used.

g4p_controls.GAnimIcon.GAnimIcon ( PApplet  papp,
String  fname,
int  nbrCols,
int  nbrRows,
int  interval 
)

Create an animated icon

Parameters
pappthe PApplet object that will be used to display this icon
fnamethe name of the file containing the tiled image.
nbrColsnumber of horizontal tiles
nbrRowsnumber of vertical tiles
intervalthe time between displaying frames in milliseconds
g4p_controls.GAnimIcon.GAnimIcon ( PApplet  papp,
PImage  image,
int  nbrCols,
int  nbrRows,
int  interval 
)

Create an animated icon

Parameters
pappthe PApplet object that will be used to display this icon
imagethe tiled image containing the frames
nbrColsnumber of horizontal tiles
nbrRowsnumber of vertical tiles
intervalthe time between displaying frames in milliseconds

Member Function Documentation

void g4p_controls.GAnimIcon.advanceAnimationFrame ( GTimer  timer)

Required by GTimer to advance frame

Parameters
timerthe associated timer
GAnimIcon g4p_controls.GAnimIcon.animate ( )

Animate the entire sequence.

Returns
the icon being animated
GAnimIcon g4p_controls.GAnimIcon.animate ( String  id)

Animate the icon using store clip details but use the specified frame interval instead of the stored value.
You can also decide on the number of times the clip is to be shown.

Parameters
idthe unique id for the clip
Returns
the icon being animated
GAnimIcon g4p_controls.GAnimIcon.copy ( )

Returns a copy of this animated icon to be used with another control.
Note: animated icons must only be used with one second control. Use copy() to get a duplicate icon which can be used with another control.

Returns
a copy of this icon
GAnimIcon g4p_controls.GAnimIcon.getThis ( )
Returns
returns this animated icon.
void g4p_controls.GAnimIcon.listClips ( String  title)

Display a list of animation clips for this icon

Parameters
titletitle for this list
GAnimIcon g4p_controls.GAnimIcon.setFrame ( int  fn)

Set the current frame to be displayed. The supplied frame number will be constrained to a valid value.
This is ignored if the animation clip is running.

Parameters
fnthe frame number to display.
Returns
this icon
GAnimIcon g4p_controls.GAnimIcon.setInterval ( int  interval)

Change the interval between frames for the current animation clip.

Parameters
intervalthe time between frames in milliseconds
Returns
this icon
GAnimIcon g4p_controls.GAnimIcon.setInterval ( String  id,
int  interval 
)

Change the interval between frames for the animation clip with specified id.

Parameters
idthe animation id
intervalthe time between frames in milliseconds
Returns
this icon
GAnimIcon g4p_controls.GAnimIcon.start ( )

Resume an animation that has previously been stopped with stop()

Returns
this icon
GAnimIcon g4p_controls.GAnimIcon.stop ( )

Stop the current animation. The animation can be resumed with start()

Returns
this icon
GAnimIcon g4p_controls.GAnimIcon.storeAnim ( String  id,
int  start,
int  end,
int  interval 
)

Store details of an animation sequence for later use.

Parameters
idunique id for this animation clip
startfirst frame for this clip
endlast frame for this clip
intervalthe time (ms) between frames
Returns
the icon being stored
GAnimIcon g4p_controls.GAnimIcon.storeAnim ( String  id,
int  start,
int  end,
int  interval,
int  nbrLoops 
)

Store details of an animation sequence for later use.

Parameters
idunique id for this animation clip
startfirst frame for this clip
endlast frame for this clip
intervalthe time (ms) between frames
nbrLoopsthe number of times this clip is played, (0 = play forever)
Returns
the icon being stored