MCPcopy Create free account
hub / github.com/cinder/Cinder / Circle

Class Circle

samples/_timeline/DragTween/src/DragTweenApp.cpp:12–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace std;
11
12class Circle {
13 public:
14 Circle( Color color, float radius, vec2 initialPos, vec2 homePos )
15 : mColor( color ), mRadius( radius ), mPos( initialPos ), mHomePos( homePos )
16 {}
17
18 void draw() const {
19 gl::color( ColorA( mColor, 0.75f ) );
20 gl::drawSolidCircle( mPos, mRadius );
21 }
22
23 void startDrag() {
24 mPos.stop();
25 }
26
27 void dragRelease() {
28 // return to our home position in 1sec, easing using EaseOutBack
29 app::timeline().apply( &mPos, mHomePos, 1.0f, EaseOutBack( 3 ) );
30 }
31
32 Color mColor;
33 vec2 mHomePos;
34 Anim<vec2> mPos;
35 Anim<float> mRadius;
36};
37
38class DragTweenApp : public App {
39 public:

Callers 1

setupMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected