G4P (GUI for Processing) 4.3.11
A set of GUI controls for your Processing sketch.
Loading...
Searching...
No Matches
g4p_controls.GIcon Class Reference
Inheritance diagram for g4p_controls.GIcon:

Public Member Functions

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

 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

◆ GIcon() [1/3]

g4p_controls.GIcon.GIcon ( )
protected

This constructor is not to be used.

◆ GIcon() [2/3]

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.
nbrColsnumber of horizontal tiles
nbrRowsnumber of vertical tiles

◆ GIcon() [3/3]

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.
nbrColsnumber of horizontal tiles
nbrRowsnumber of vertical tiles

Member Function Documentation

◆ copy()

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

Reimplemented in g4p_controls.GAnimIcon.

◆ getFrame() [1/2]

PImage g4p_controls.GIcon.getFrame ( )
Returns
the image for the current frame to be displayed.

◆ getFrame() [2/2]

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

◆ getThis()

GIcon g4p_controls.GIcon.getThis ( )
Returns
returns this icon.

Reimplemented in g4p_controls.GAnimIcon.

◆ height()

int g4p_controls.GIcon.height ( )
Returns
the height of the icon

◆ width()

int g4p_controls.GIcon.width ( )
Returns
the width of the icon