Created
September 28, 2014 20:14
-
-
Save andrew-dash/b7bf353df4b2c17d63ac to your computer and use it in GitHub Desktop.
Intro OF Functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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