Skip to content

Instantly share code, notes, and snippets.

@andrew-dash
Created September 28, 2014 20:14
Show Gist options
  • Select an option

  • Save andrew-dash/b7bf353df4b2c17d63ac to your computer and use it in GitHub Desktop.

Select an option

Save andrew-dash/b7bf353df4b2c17d63ac to your computer and use it in GitHub Desktop.
Intro OF Functions
ofSetWindowShape(width, height);
ofSetCircleResolution(size);
ofBackground(r,g,b);
ofSetWindowTitle("graphics example");
ofSetFrameRate(framerate);
ofEnableAlphaBlending();
ofSetColor(r,g,b,a);
image.loadImage("image.png");
// shapes
ofFill(); // draw "filled shapes"
ofStroke(r,g,b);
ofCircle(x,y,radius);
ofEllipse(x,y,width,height);
ofRect(x1,y1,x2,y2);
ofTriangle(x1,y1,x2,y2,x3,y3);
//text
ofDrawBitmapString("some text", x,y);
ofRandom(min,max);
void keyPressed(int key)
{
if('a' == key) {
// do something
}
else if(' ' == key)
{
ofToggleFullscreen();
}
}
ofLogNotice("mousePressed()") << x;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment