Coder Social home page Coder Social logo

Comments (8)

FWeinb avatar FWeinb commented on May 19, 2024

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.

from esp8266-oled-ssd1306.

nicof38 avatar nicof38 commented on May 19, 2024

So in this case what is the aim of having multiple overlay defined?
It does not work the same way as frames? Frames does not overwrite on each
others so I was expecting to have the same behavior for multiple overlays.

One overlay should only overlay frames but I would not expect each overlay
to overlay any others.

Anyway if it is the way it is designed, how should we use the multiple
overlays callback in order to have something readable?

Thanks

from esp8266-oled-ssd1306.

FWeinb avatar FWeinb commented on May 19, 2024

In an overlay you can draw anywhere on the display. You can do something like this:

void msOverlay2(OLEDDisplay display, OLEDDisplayUiState state) {
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->setFont(ArialMT_Plain_10);
display->drawString(0, 0, String("TESTTESTTEST"));
}

That would draw the string "TESTTESTTEST" in the upper left corner

from esp8266-oled-ssd1306.

nicof38 avatar nicof38 commented on May 19, 2024

Yes, this is what I've done next. Anyway still surprised that 2 overlays
callback can overwrite on each others whereas frames clear everything
between.

What should be the best option to update information on an overlay area
(with different information type, not a timestamp for example)? Should I
add a third overlay in order to clear the selected area ? Should i use an
empty graphic to do so ?

from esp8266-oled-ssd1306.

FWeinb avatar FWeinb commented on May 19, 2024

Sorry but I don't understand what you would like to achieve. Maybe @squix78 can help?
Overlays are information that are rendered always (even in a frame transition) so they can be used for status indicators like wifi signals or time, we choose to implement the ability to add more overlays so one can separate different aspects of the ui (not everyone want's to e.g. display an wifi signal indicator).

from esp8266-oled-ssd1306.

nicof38 avatar nicof38 commented on May 19, 2024

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 ?

from esp8266-oled-ssd1306.

FWeinb avatar FWeinb commented on May 19, 2024

Yeah, we could really improve on example code for this library.

from esp8266-oled-ssd1306.

hallard avatar hallard commented on May 19, 2024

Moved to #69

from esp8266-oled-ssd1306.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.