-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDEPACMan.h
37 lines (31 loc) · 838 Bytes
/
DEPACMan.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef OFX_CT_PAINTING_DEPACMAN
#define OFX_CT_PAINTING_DEPACMAN
#include "DEParameter.h"
class DEPACMan : public DEBasic<stPACManP>
{
public:
static void draw(const stPACManP& param)
{
beginDraw(param);
{
float fR_ = param.fsize * 0.5;
float fDegree_ = param.mouthPerc * 90.0 * 0.5;
ofPath path_;
path_.clear();
path_.setFillColor(ofColor(param.fillcolor, param.falpha));
path_.setFilled(true);
path_.setStrokeWidth(param.flineWidth);
path_.setStrokeColor(ofColor(param.linecolor, param.falpha));
path_.setArcResolution(50);
ofVec2f s_;
s_ = ofVec2f(-1, 0).rotate(fDegree_) * fR_;
path_.moveTo(0, 0);
path_.lineTo(s_);
path_.arc(0, 0, fR_, fR_, 180.0 + fDegree_, 180.0 - fDegree_);
path_.close();
path_.draw();
}
endDraw();
}
};
#endif // !OFX_CT_PAINTING_DEPACMAN