We are about to switch to a new forum software. Until then we have removed the registration on this forum.
i have been triying this for 2 days now, nothing works here is my last attempt using a div and css: https://codepen.io/zltm/pen/gXbZbJ
im going mad here, any help?
Answers
search is your friend... It often leads to an answer ;)
Are you referring to resizing your window or your effect responding to your mouseX?
Unrelated to your question but for you to consider the following small changes:
Kf
Keyword: stars-flying
yeah, tried to follow the demo example but it does not seems to be working, run out of tutorials on the web and discussions to follow
I am able to see the speed changes of the stars based on mouse position. Is that what you are referring to?
Kf
No, I would like to improve that but the problem is another one when I resize my screen the canvas dont resize, it only picks a size when the page is loaded and never again making it not responsive.
https://p5js.org/reference/#/p5/windowResized
https://Forum.Processing.org/two/discussions/tagged?Tag=windowresized()
@zltm - did you try the solution I linked to above?
@blindfish yeah, didnt worked, this is really weird, if i create a canvas just to show a rectangle it resizes but it does not work with the animation at all
if this is the case I'm thinking it will be easier to just do it on plain CSS and js instead of p5
@zltm your codepen demo has a number of issues:
* I don't have time to debug properly now; but may find time to figure this out later today...
@zltm - assuming you're using the same code as in the codepen link I've just spotted the main problem: your CSS does nothing since it's not being applied to the sketch canvas...:
index.html
sketch
What you're presumably trying to do is get the sketch canvas inside
<div class="can">
. You can do that with the DOM library:Now in your CSS: