Skip to content

Instantly share code, notes, and snippets.

@tado
Last active December 23, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tado/6709701 to your computer and use it in GitHub Desktop.
Save tado/6709701 to your computer and use it in GitHub Desktop.
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
// 画面基本設定
ofSetFrameRate(60);
ofBackground(63);
ofSetCircleResolution(32);
// 画面内のランダムな場所を指定
position.x = ofRandom(ofGetWidth());
position.y = ofRandom(ofGetHeight());
}
//--------------------------------------------------------------
void testApp::update(){
}
//--------------------------------------------------------------
void testApp::draw(){
// 設定した場所に円を描く
ofSetHexColor(0x3399cc);
ofCircle(position, 10);
}
#pragma once
#include "ofMain.h"
class testApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
// 円の位置
ofVec2f position;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment