-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OverLays are written on top of each other #59
Comments
That is the expected behaviour. What is your expectations with doing this? A overlay is a way to define frame independent data on the display (like a clock). If you draw to the same pixels they sure overwrite what is currently there. |
So in this case what is the aim of having multiple overlay defined? One overlay should only overlay frames but I would not expect each overlay Anyway if it is the way it is designed, how should we use the multiple Thanks |
In an overlay you can draw anywhere on the display. You can do something like this:
That would draw the string "TESTTESTTEST" in the upper left corner |
Yes, this is what I've done next. Anyway still surprised that 2 overlays What should be the best option to update information on an overlay area |
Sorry but I don't understand what you would like to achieve. Maybe @squix78 can help? |
OK, so based on your latest explanation, I think I get it. Adding more overlays does not behave like adding multiple frames. Every defined overlays are rendered all the time, and that is why they can interfere on each others. Maybe you should add the way it has to be used with multiple overlays in the UI demo code ? |
Yeah, we could really improve on example code for this library. |
Moved to #69 |
While using the SSD1306UiDemo, I've modified this one in order to have:
`void msOverlay1(OLEDDisplay display, OLEDDisplayUiState state) {
display->setTextAlignment(TEXT_ALIGN_RIGHT);
display->setFont(ArialMT_Plain_10);
display->drawString(128, 0, String(millis()));
}
void msOverlay2(OLEDDisplay display, OLEDDisplayUiState state) {
display->setTextAlignment(TEXT_ALIGN_RIGHT);
display->setFont(ArialMT_Plain_10);
display->drawString(128, 0, String("TESTTESTTEST"));
}`
Then:
// Overlays are statically drawn on top of a frame eg. a clock OverlayCallback overlays[] = { msOverlay1,msOverlay2 }; int overlaysCount = 2;
Running the example with these modifications, and you can see that "TESTTESTTEST" is written on top of the current milliseconds.
The text was updated successfully, but these errors were encountered: