MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Draw

Method Draw

Source/ScriptModule.cpp:1598–1623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1596}
1597
1598void ScriptModule::LineEventTracker::Draw(CodeEntry* codeEntry, int style, ofColor color)
1599{
1600 ofPushStyle();
1601 ofFill();
1602 for (int i = 0; i < (int)mText.size(); ++i)
1603 {
1604 float alpha = style == 0 ? 200 : 150;
1605 float fadeMs = style == 0 ? 200 : 150;
1606 if (gTime - mTimes[i] > 0 && gTime - mTimes[i] < fadeMs)
1607 {
1608 ofSetColor(color, alpha * (1 - (gTime - mTimes[i]) / fadeMs));
1609 ofVec2f linePos = codeEntry->GetLinePos(i, false);
1610 if (style == 0)
1611 ofRect(linePos.x + 1, linePos.y + 3, 4, codeEntry->GetCharHeight(), L(corner, 0));
1612 if (style == 1)
1613 ofCircle(linePos.x + 11, linePos.y + 10, 5);
1614
1615 if (mText[i] != "")
1616 {
1617 linePos = codeEntry->GetLinePos(i, K(end));
1618 DrawTextNormal(mText[i], linePos.x + 10, linePos.y + 15);
1619 }
1620 }
1621 }
1622 ofPopStyle();
1623}
1624
1625ScriptReferenceDisplay::ScriptReferenceDisplay()
1626{

Callers 1

DrawModuleMethod · 0.45

Calls 10

ofPushStyleFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofCircleFunction · 0.85
DrawTextNormalFunction · 0.85
ofPopStyleFunction · 0.85
sizeMethod · 0.80
GetLinePosMethod · 0.80
GetCharHeightMethod · 0.80

Tested by

no test coverage detected