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

Public Member Functions

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

 GIcon ()
 

Protected Attributes

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 non-animated icons to be used with GButton, GLabel, GCheckbox and GOption controls.

Introduced in v4.1

Author
Peter Lager

Constructor & Destructor Documentation

g4p_controls.GIcon.GIcon ( )
protected

This constructor is not to be used.

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

Create an icon

Parameters
pappthe PApplet object that will be used to display this icon
fnamethe name of the file containing the tiled image. Create an icon
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
g4p_controls.GIcon.GIcon ( PApplet  papp,
PImage  image,
int  nbrCols,
int  nbrRows 
)

Create an icon.

Parameters
pappthe PApplet object that will be used to display this icon
imagethe tiled image containing the frames. Create an icon.
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

Member Function Documentation

GIcon g4p_controls.GIcon.copy ( )
Returns
a copy of this icon to be used with another control.
PImage g4p_controls.GIcon.getFrame ( int  fn)

Get the image to be displayed for the specified frame number. The supplied frame number will be constrained to a valid value.

Parameters
fnthe frame image to retrieve.
Returns
this icon
PImage g4p_controls.GIcon.getFrame ( )
Returns
the image for the current frame to be displayed.
GIcon g4p_controls.GIcon.getThis ( )
Returns
returns this icon.
int g4p_controls.GIcon.height ( )
Returns
the height of the icon
int g4p_controls.GIcon.width ( )
Returns
the width of the icon