Skip to content

Conversation

@BlueWitherer
Copy link
Contributor

@BlueWitherer BlueWitherer commented Aug 16, 2025

Since the base game doesn't use a class to create its progress bar UI, I would like to propose a helper class that I wrote that can help developers easily re-create them without having to use and set up the sprites and set the texture rects themselves.

ProgressBar

This class creates a progress bar. It can mimic the style of the progress bar shown while playing a level, or the style of the Normal/Practice mode progress bars shown when looking at your current best progress in the level. It inherits cocos2d::CCNode.

static ProgressBar* create(); // Create the custom progress bar

void setStyle(ProgressBarStyle style); // Set the style of the progress bar
void setProgressBarFillColor(ccColor3B color); // Set the color of the fill of the bar

virtual void updateProgress(float value); // Update the size of the fill of the bar

float getProgress() const; // Get the current progress percentage of the bar
CCLabelBMFont* getProgressLabel() const; // Get the progress percentage text label node
ProgressBarStyle getProgressBarStyle() const; // Get the current style of the progress bar

void showProgressLabel(bool show); // Show the label displaying the current percentage of progress
Example
auto bar = ProgressBar::create();
bar->setProgressBarFillColor({100, 100, 255});
bar->setStyle(ProgressBarStyle::Solid);
bar->showProgressLabel(false); // Don't show percentage text

bar->updateProgress(20.5f); // Sets to 20.5% full

this->addChild(bar);

progresstest.mp4

@BlueWitherer BlueWitherer marked this pull request as ready for review August 16, 2025 12:44
Copy link
Member

@HJfod HJfod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this PR! Left a few comments & fix suggestions, but looking good overall :)

@BlueWitherer
Copy link
Contributor Author

appreciate the feedback! i've made adjustments based on what you mentioned and asked for - lmk if anything else could use further tweaking :D

@BlueWitherer BlueWitherer changed the title Progress bar helper classes Progress bar helper class Sep 1, 2025
@BlueWitherer BlueWitherer requested a review from HJfod September 1, 2025 22:33
@BlueWitherer
Copy link
Contributor Author

sorry about all that, hopefully this fixes it!

Copy link
Member

@HJfod HJfod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, don't have any major complaints, just some styling suggestions! Tyvm for this PR!

@BlueWitherer
Copy link
Contributor Author

happy to contribute! hopefully i've made this as best as it could possibly be!

@BlueWitherer BlueWitherer requested a review from matcool October 14, 2025 13:36
@BlueWitherer BlueWitherer requested a review from HJfod November 18, 2025 01:23
Copy link
Member

@HJfod HJfod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@HJfod HJfod merged commit 7601777 into geode-sdk:main Nov 18, 2025
@BlueWitherer
Copy link
Contributor Author

happy to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants