and I am trying to write my own class in which I would like to do the sprite.drawPixel function. In other words I would like to do the sprite.drawPixel function from within the class rather than within the main sketch.
My problem is trying to find a way to pass sprite into the class that I am writing.
I have done a bunch of searching/reading over the last couple days but am getting no where.
Ideally, I believe I would pass a pointer to sprite into my class, and then reference it somehow within class to perform the
sprite.drawPixel(x, y, colour);
However, I am totally stuck on how to define the public and private portions of the class such that I can pass the sprite in from the calling mainline sketch, as well as how to define the call in the sketch.
I hope the above is clear, and that someone can share a concreate example of how to do this correctly.
Thank you - this looks super helpful. I've started to implement it and its looking pretty promising at this point. Very thoughtful of you to have posted such a thorough reply. I'm sure it will be of help to others too. Thanks again.
Edit: @bitseeker I finalized building this - the above worked great - thanks again!