We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi
When I use android in eclipse, I can easily use a global variable (a variable that I have simply declare on the upper part of the Main Class) in an inner class. I just add the name I gave to the parent class to the name of the variable : parent.myVariable
I try to do the same in android studio and I cannot get it to work
Any idea on why it is so ?
cheers
Answers
I didn't understand a thing in your answer GoTo :]
but ! I found the answer myself I did implement my inner class the way it is explained here and it helped my get the errors fixed as far as calling processing methods like rect() or dist()...
In this tutorial, it was said to use
PApplet parent; // The parent PApplet that we will render ourselves onto
in the beginning of the class and then refer to parent (or any other name you want to call it) in the rest of the Class code to "tell a Class object about a MyProcessingSketch "Thing is, it didn't work for my global variables. But here is the Solution don't use
PApplet parent;
instead use
MyProcessingSketch parent; (or whatever your main Class name is)
So in the case of my processing android app, the main Class is called PhoebusGame_Main and my Dot Class goes like
see how I use p5. to call things from my main ? :)
cheers