Skip to content

Instantly share code, notes, and snippets.

@kylejohnston
Created March 26, 2019 08:13
Show Gist options
  • Select an option

  • Save kylejohnston/06e49ab53d70c809fa9c23308389dc9d to your computer and use it in GitHub Desktop.

Select an option

Save kylejohnston/06e49ab53d70c809fa9c23308389dc9d to your computer and use it in GitHub Desktop.
A starter environment for projects using Processing and the HYPE framework
<snippet><content><![CDATA[
${1:import processing.pdf.*;}
import hype.*;
// ENVIRONMENT VARIABLES *************************************************
// Screen: 1440×900; Dribbble: 800×600; HD: 1920×1080 or 960×540)
int stageW = 800;
int stageH = 600;
color clrBG = #242424;
String pathDATA = "../data/";
// LETS RENDER IMAGES ****************************************************
int renderMax = 1800; // for animations, how many frames to output
String renderPATH = "../output/";
// ***********************************************************************
HCanvas canvas;
void settings() {
size(stageW,stageH${5:,P3D});
}
void setup() {
H.init(this).background(clrBG)${6:.use3D(true)}${7:.autoClear(${8:true})};
canvas = H.add(new HCanvas()); // additions for animations: .autoClear(true).fade(100)
}
void draw() {
H.drawStage();
${9:// }saveFrame(pathData + "frames/#########.tif"); if (frameCount == 900) exit();}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>hype_environment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.pde</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment