We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hello,
i came across this example here: http://www.openprocessing.org/sketch/74153
which uses processing.js and somehow, magically the code is using externals.context... to set some dropShadow for the shapes being drawn.
i tried to "port" this to p5js, but i failed. does anyone have any idea if this is actually possible ? if so, a little sample file would be totally great !!!
(i already figured i probably should include the dom lib....)
all the best
Lia.-
Answers
That code is mixing Java & JavaScript syntaxes. Thus it isn't compatible w/ "Java Mode" anymore. [..]
The ideal is when we can develop an app in "Java Mode" and be able to deploy it in "JavaScript Mode"! (*)
IMO, when "JS Mode" is violating Java syntax, it's better to write the app in "CoffeeScript Mode".
And of course, the future in "p5js" mode too! =:)
this should indeed be possible in p5.js, will work on posting an example shortly!
the code below should work just like the example you posted. basically, the key is, anywhere you see something like:
externals.context or getContext("2d")
you should be able to use the variable drawingContext instead.
this is great! thanks !!! :)