Why does the floowing code give a null point exception error? Processing highlights the line where I have called the line function. This is a p5js code which I am trying to recreate in processing.
The code included in this post has been taken out because it completely solved the problem,
Only actual things @svan did was globally declaring variable tex w/ PGraphics tex;, plus adding tex.beginDraw(); & tex.endDraw(); to the OP’s already provided code!
, instead of just providing pre-made answers.
There’s nothing to provide but link to very basic requirements for dealing w/ PGraphics objects.
Be careful to scrutinize code carefully and learn from it.
The code that was removed had the tex.endDraw() inside the loop which may not yield the intended or desired results.
You can try it inside the loop and outside of the loop to see the difference.
The code does run either way, but the output is markedly different. Apparently I did not keep a copy and just deleted it after I solved the null pointer error, so it is possible it was initially inside the for loop when obviously it should be outside. I always assumed I could always go back to the original post and see my code, but obviously that is not the case. Good to know that some of us have more editorial tools than others, and some have the power to just wipe away an answer.