Skip to content
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

LCDGFX doesn't appear pixel aligned #106

Open
schwos opened this issue Aug 3, 2023 · 5 comments
Open

LCDGFX doesn't appear pixel aligned #106

schwos opened this issue Aug 3, 2023 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@schwos
Copy link

schwos commented Aug 3, 2023

So we have been positioning text and graphics on our SSD1306 OLED with the library. When we expect to move text to say 45, 32 it doesn't appear that it will go through but formats in general the general spot. When you attempt to be precise it can become challenging.

As well when putting BitXMP on the screen and then a box around it it appears that there is an overlap. Anyway to turn on transparent background so it doesn't turn a pixel off causing flickering as it repaints?

@schwos schwos added the question Further information is requested label Aug 3, 2023
@lexus2k
Copy link
Owner

lexus2k commented Aug 4, 2023

@schwos For this case you need to use NanoEngine to avoid flickering when drawing. Please check the examples section. Snowflakes is a good one.
Some display demos have nano engine usage examples for spriteDemo section.

@schwos
Copy link
Author

schwos commented Aug 8, 2023

I have successfully deployed the nano engine for the project. The one challenge I am working to develop a low ram solution is right justifying text in specific graphic boxes created on the OLED. I was reviewing the source and see a gettextsize within font.cop which uses the fonts width + spacing determine total width and fonts height.

Is there an easy way to get this information so one could calculate position? It could be a lot less memory then doing char or string adaptations to add space at the beginning of the text to output.

Appreciate suggestions..

@schwos
Copy link
Author

schwos commented Aug 8, 2023

I figured it out.. engine.getCanvas().getFont().getTextSize(buff)

@lexus2k
Copy link
Owner

lexus2k commented Aug 8, 2023

Since you are working on low ram solution, any attempt to avoid flickering will require a double buffering. The NanoEngine allows to reduce ram usage. but it still consumes a ram.
The problem of many i2c, 3-wire or 4-wire spi displays is that the interface doesn't allow reading of pixels from GDRAM. So, with direct API when you place text over some picture, there is no way to read old pixels do OR operation and write the new set of pixels back. So, this is a challenge.
Some color displays have a hack to read pixels back, but that's a hack and not normal SPI usage.

@schwos
Copy link
Author

schwos commented Aug 9, 2023

Yep so far RAM need by nano engine, fonts and functions fit with Arduino solution fine. With our ESP32 solution doors open a bit not as restrictive. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants