G4P (GUI for Processing) 4.3.11
A set of GUI controls for your Processing sketch.
|
Classes | |
class | AnimClip |
Public Member Functions | |
void | advanceAnimationFrame (GTimer timer) |
GAnimIcon | animate () |
GAnimIcon | animate (String id) |
GAnimIcon | copy () |
GAnimIcon (PApplet papp, PImage image, int nbrCols, int nbrRows, int interval) | |
GAnimIcon (PApplet papp, String fname, 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 () |
PImage | getFrame (int fn) |
GIcon | getThis () |
GIcon (PApplet papp, PImage image, int nbrCols, int nbrRows) | |
GIcon (PApplet papp, String fname, 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, AnimClip > | clips = 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 |
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
|
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
papp | the PApplet object that will be used to display this icon |
fname | the name of the file containing the tiled image. |
nbrCols | number of horizontal tiles |
nbrRows | number of vertical tiles |
interval | the time between displaying frames in milliseconds |
g4p_controls.GAnimIcon.GAnimIcon | ( | PApplet | papp, |
PImage | image, | ||
int | nbrCols, | ||
int | nbrRows, | ||
int | interval | ||
) |
Create an animated icon
papp | the PApplet object that will be used to display this icon |
image | the tiled image containing the frames |
nbrCols | number of horizontal tiles |
nbrRows | number of vertical tiles |
interval | the time between displaying frames in milliseconds |
void g4p_controls.GAnimIcon.advanceAnimationFrame | ( | GTimer | timer | ) |
Required by GTimer to advance frame
timer | the associated timer |
GAnimIcon g4p_controls.GAnimIcon.animate | ( | ) |
Animate the entire sequence.
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.
id | the unique id for the clip |
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.
Reimplemented from g4p_controls.GIcon.
GAnimIcon g4p_controls.GAnimIcon.getThis | ( | ) |
Reimplemented from g4p_controls.GIcon.
void g4p_controls.GAnimIcon.listClips | ( | String | title | ) |
Display a list of animation clips for this icon
title | title 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.
fn | the frame number to display. |
Reimplemented from g4p_controls.GIcon.
GAnimIcon g4p_controls.GAnimIcon.setInterval | ( | int | interval | ) |
Change the interval between frames for the current animation clip.
interval | the time between frames in milliseconds |
GAnimIcon g4p_controls.GAnimIcon.setInterval | ( | String | id, |
int | interval | ||
) |
Change the interval between frames for the animation clip with specified id.
id | the animation id |
interval | the time between frames in milliseconds |
GAnimIcon g4p_controls.GAnimIcon.start | ( | ) |
Resume an animation that has previously been stopped with stop()
GAnimIcon g4p_controls.GAnimIcon.stop | ( | ) |
Stop the current animation. The animation can be resumed with start()
GAnimIcon g4p_controls.GAnimIcon.storeAnim | ( | String | id, |
int | start, | ||
int | end, | ||
int | interval | ||
) |
Store details of an animation sequence for later use.
id | unique id for this animation clip |
start | first frame for this clip |
end | last frame for this clip |
interval | the time (ms) between frames |
GAnimIcon g4p_controls.GAnimIcon.storeAnim | ( | String | id, |
int | start, | ||
int | end, | ||
int | interval, | ||
int | nbrLoops | ||
) |
Store details of an animation sequence for later use.
id | unique id for this animation clip |
start | first frame for this clip |
end | last frame for this clip |
interval | the time (ms) between frames |
nbrLoops | the number of times this clip is played, (0 = play forever) |