String[] fonts = PFont.list(); String[] preferredFonts = { "Mono", "Courier" }; PFont font = null;
/** Danger: available for advanced subclassing, but here be dragons. */ protected void showSurface() { if (getGraphics().displayable()) { surface.setVisible(true); } }
public void fill(int rgb) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()"); return; } fill = true; colorCalc(rgb); fillColor = calcColor; if (!setAmbient) { ambientColor = fillColor; } }
public PGraphics createCanvas(int w, int h, String renderer, int quality) { PGraphics pg = app.createGraphics(w, h, renderer); pg.smooth(quality); return pg; }
public void setTint(int fill) { if (openShape) { PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()"); return; } tintColor = fill; if (vertices != null) { for (int i = 0; i < vertices.length; i++) { setFill(i, fill); } } }
/** * @param z forward/back translation */ public void translate(float x, float y, float z) { checkMatrix(3); matrix.translate(x, y, z); }
@Override public void setSize(int w, int h) { deprecationWarning("setSize"); surface.setSize(w, h); }
/** * @param x percentage to scale the object in the x-axis * @param y percentage to scale the object in the y-axis * @param z percentage to scale the object in the z-axis */ public void scale(float x, float y, float z) { checkMatrix(3); matrix.scale(x, y, z); }
public void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) { checkMatrix(3); matrix.apply(n00, n01, n02, n03, n10, n11, n12, n13, n20, n21, n22, n23, n30, n31, n32, n33); }
@Override public void setTitle(String title) { deprecationWarning("setTitle"); surface.setTitle(title); }
public void stroke(float x, float y, float z, float alpha) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()"); return; } stroke = true; colorCalc(x, y, z, alpha); strokeColor = calcColor; }
public void tint(float x, float y, float z) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()"); return; } tint = true; colorCalc(x, y, z); tintColor = calcColor; }
public void specular(float gray) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "specular()"); return; } colorCalc(gray); specularColor = calcColor; }
public void fill(float gray) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()"); return; } fill = true; colorCalc(gray); fillColor = calcColor; if (!setAmbient) { ambientColor = fillColor; } }
public void stroke(float x, float y, float z) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()"); return; } stroke = true; colorCalc(x, y, z); strokeColor = calcColor; }
public void tint(int rgb) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()"); return; } tint = true; colorCalc(rgb); tintColor = calcColor; }
public void tint(float x, float y, float z, float alpha) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()"); return; } tint = true; colorCalc(x, y, z, alpha); tintColor = calcColor; }
public void ambient(float gray) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "ambient()"); return; } setAmbient = true; colorCalc(gray); ambientColor = calcColor; }
public void specular(int rgb) { if (!openShape) { PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "specular()"); return; } colorCalc(rgb); specularColor = calcColor; }