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

Method DrawModule

Source/HelpDisplay.cpp:83–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void HelpDisplay::DrawModule()
84{
85 ofPushStyle();
86 ofSetColor(50, 50, 50, 200);
87 ofFill();
88 ofRect(0, 0, mWidth, mHeight);
89 ofPopStyle();
90
91 DrawTextRightJustify(GetBuildInfoString(), mWidth - 5, 12);
92
93 mShowTooltipsCheckbox->Draw();
94 mCopyBuildInfoButton->Draw();
95 mDumpModuleInfoButton->SetShowing(GetKeyModifiers() == kModifier_Shift);
96 mDumpModuleInfoButton->Draw();
97 mDoModuleScreenshotsButton->SetShowing(GetKeyModifiers() == kModifier_Shift);
98 mDoModuleScreenshotsButton->Draw();
99 mDoModuleDocumentationButton->SetShowing(GetKeyModifiers() == kModifier_Shift);
100 mDoModuleDocumentationButton->Draw();
101
102 DrawTextNormal("video overview available at:", 4, 73);
103 mTutorialVideoLinkButton->Draw();
104 DrawTextNormal("documentation:", 4, 92);
105 mDocsLinkButton->Draw();
106 DrawTextNormal("join the ", 260, 92);
107 mDiscordLinkButton->Draw();
108
109 mHeight = 100;
110 const int kLineHeight = 14;
111 ofClipWindow(0, mHeight, mWidth, (int)mHelpText.size() * kLineHeight, true);
112 for (size_t i = 0; i < mHelpText.size(); ++i)
113 {
114 DrawTextNormal(mHelpText[i], 4, mHeight - mScrollOffsetY);
115 mHeight += 14;
116 }
117 ofResetClipWindow();
118
119 if (mScreenshotCountdown <= 0)
120 {
121 if (mScreenshotState == ScreenshotState::WaitingForScreenshot)
122 {
123 std::string typeName = mScreenshotsToProcess.begin()->mLabel;
124 mScreenshotsToProcess.pop_front();
125
126 ofRectangle rect = mScreenshotModule->GetRect();
127 rect.y -= IDrawableModule::TitleBarHeight();
128 rect.height += IDrawableModule::TitleBarHeight();
129 rect.grow(10);
130 RenderScreenshot(rect.x, rect.y, rect.width, rect.height, typeName + ".png");
131
132 mScreenshotCountdown = 10;
133 if (!mScreenshotsToProcess.empty())
134 mScreenshotState = ScreenshotState::WaitingForSpawn;
135 else
136 mScreenshotState = ScreenshotState::None;
137 }
138 }
139 else
140 {

Callers

nothing calls this directly

Calls 15

ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofFillFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
DrawTextRightJustifyFunction · 0.85
GetBuildInfoStringFunction · 0.85
GetKeyModifiersFunction · 0.85
DrawTextNormalFunction · 0.85
ofClipWindowFunction · 0.85
ofResetClipWindowFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected