Skip to content

Instantly share code, notes, and snippets.

@KrabCode
Last active October 17, 2019 09:35
Show Gist options
  • Select an option

  • Save KrabCode/f7db08edad3462e856208f0ec7a19cee to your computer and use it in GitHub Desktop.

Select an option

Save KrabCode/f7db08edad3462e856208f0ec7a19cee to your computer and use it in GitHub Desktop.
IntelliJ IDEA file template for my Processing Sketches
import applet.HotswapGuiSketch;
import processing.core.PGraphics;
public class ${NAME} extends HotswapGuiSketch {
public static void main(String[] args) {
HotswapGuiSketch.main("${NAME}");
}
private float t;
private PGraphics pg;
public void settings() {
size(800, 800, P2D);
}
public void setup() {
surface.setAlwaysOnTop(true);
pg = createGraphics(width, height, P2D);
pg.beginDraw();
pg.background(0);
pg.endDraw();
}
public void draw() {
t += radians(slider("t",1, true));
pg.beginDraw();
pg.background(0);
pg.endDraw();
image(pg, 0, 0);
rec(pg);
gui();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment