From: Cristian D. R. V. <rvc...@gm...> - 2017-09-11 23:10:33
|
Hi, I'm Cristian. I'm working in Jython for use the processing's core but I have a problem to translate this example https://processing.org/tutorials/gettingstarted/ to Jython, because the class PApplet have a method and an attribute with the same name (mousePressed). The PApplet's source code is: https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java . And the code that I have is: from processing.core import PApplet class test(PApplet): def settings(self): self.size(480, 120) def draw(self): if self.mousePressed: self.fill(0) else: print type(self.mousePressed) self.fill(255) self.ellipse(self.mouseX, self.mouseY, 80, 80) if __name__ == "__main__": processingArgs = ["test"] myProcessingSketch = test() myProcessingSketch.runSketch(processingArgs) Thank you for your time (and sorry for the bad english :p) |