|
static PImage[] | getImage (PApplet app, String filename) |
|
static PImage[] | getImage (PApplet app, String filename, int nbrCols, int nbrRows) |
|
|
static PImage[] | makeImageArray (PApplet app, PImage img, int nCols, int nRows) |
|
|
static HashMap< String, PImage[]> | textures = new HashMap<String, PImage[]>() |
|
Utility class to load and tile images.
- Author
- Peter Lager
◆ getImage() [1/2]
static PImage[] game2dai.entityshapes.ps.ImageBank.getImage |
( |
PApplet |
app, |
|
|
String |
filename |
|
) |
| |
|
static |
Load a bitmap file and return a reference to an array (size will be 1) with the image as the sole frame.
- Parameters
-
app | the PApplet object (sketch) |
filename | the name of the bitmap file |
- Returns
- an array containing a single PImages that represent the sole frame to flip through
◆ getImage() [2/2]
static PImage[] game2dai.entityshapes.ps.ImageBank.getImage |
( |
PApplet |
app, |
|
|
String |
filename, |
|
|
int |
nbrCols, |
|
|
int |
nbrRows |
|
) |
| |
|
static |
Load a bitmap file and create an array of PImages to represent a sequence of frames to flip through when drawing.
The frame numbers increase left to right and top down.
- Parameters
-
app | the PApplet object (sketch) |
filename | the name of the bitmap file |
nbrCols | number of horizontal tiles in the image |
nbrRows | number of vertical tiles in the image |
- Returns
- an array of PImages that represent the frames to flip through else null if file does not exist
◆ makeImageArray()
static PImage[] game2dai.entityshapes.ps.ImageBank.makeImageArray |
( |
PApplet |
app, |
|
|
PImage |
img, |
|
|
int |
nCols, |
|
|
int |
nRows |
|
) |
| |
|
staticprivate |
Split the image up into a number of frames
- Parameters
-
- Returns
- the frames as an array of PImage(s)
The documentation for this class was generated from the following file:
- /Users/peter/git/ai4games-repos/AI_4_2D_Games/src/game2dai/entityshapes/ps/ImageBank.java