Instance mode : accessing `p5` functions in an external class

Request a p5 object as 1 of the constructor’s parameters:

And pass it when instantiating the class:

The code above should work if that parameter s happens to be of datatype p5.

For more examples of classes which also request a p5 object take a look at the sketch below: