Comments (7)
Thanks for reporting this! I can reproduce this on my machine.. so I'll take a look : )
from p5.
@abhikpal I found the source of this problem. This line is resetting the background color.
Line 72 in 7269080
from p5.
commenting this out keeps the background color but I dont know the use of this line, Its probably important
from p5.
The function background()
does not, in fact, set a background color or image. It instead draws the background or image once and resets all the parameters, as the push_style
context manager is used.
This is (apparently) required for images, and has been maintained for colors, probably for consistency in working.
This is probably not the intended behavior from the code, though, as is clear from the docstring and the renderer.background_color = background_color.normalized
line.
Sending a fix.
from p5.
commenting this out keeps the background color but I dont know the use of this line, Its probably important
I comment that line and the background is fix but everything else draw in setup slill being erased when I draw something in the draw loop
from p5.
still an issue in v0.7.1
What's the status on this?
(A PR was merged a while back but the the issue is still open?)
from p5.
Still hasn't been sorted out, but I found a workaround for anyone searching for this problem.
Instead of setting your background in setup, do it once in draw (I just use an if statement). I don't know if this will mess with images, but it works if you just want to change your background at least.
from p5.
Related Issues (20)
- Possibly outdated dependency HOT 7
- Update documentation for the new skia renderer HOT 4
- Unexpected behavior of size() in setup() HOT 4
- p5/ Skia in Pycharm rendering just a black screen HOT 15
- Weird jittery behavior when `background()` is not called in `draw()` while using the skia renderer. HOT 12
- Exclude building test files into distribution builds HOT 2
- extend CI tests for windows and mac-os platform HOT 2
- Too many open files error when loading many images HOT 3
- Migrate to poetry HOT 4
- save() throws an error HOT 2
- Errors using "CORNERS" mode HOT 5
- Error installing p5 package: Failed building wheel for PyOpenGL-accelerate HOT 13
- Inconsistency between mouse_is_pressed boolean and mouse_clicked function HOT 1
- Improve installation instructions to account for unuspported Python versions HOT 6
- Setup pre-commit HOT 3
- Optimize skia rendering loop
- KeyError: 'SQAURE' when using stroke_cap(SQUARE) HOT 5
- Fix Code Formatting to Resolve Flake8 Errors in Pre-commit Hook HOT 4
- ModuleNotFoundError: No module named 'npy_tempita' when installing P5. HOT 3
- Not compatible with Python >=3.11 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p5.