We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I am looking for a way to get a user input before or inside setup(). Specifically, if I can get either "b" or "w" before the codes in setup() start happening, that is all I need. I've found some solutions regarding this but unfortunately they use codes and libraries based on Java, and I am using Python. Any ideas?
In my coding I ask for an image user input in the setup(), using G4P.selectInput(), which I was able to work it out. I am thinking maybe something similar works, and I tried GTextBase.getText() but, I really can't figure out how it works and therefore I don't know how to use it. I don't even know if it works in my case.
Answers
As I understand, you can open a dialog box and retrieve a message from the user already. I am not sure if you can use G4P as it could depend on draw. But if you use java AWT then you are half done. I am not familiar with python but I could do something like this in the java side:
char userInput =' ';
You could get away by using only setup. I just wanted to show you the existence of settings as an additional function that exist in Processing and that runs right before setup. However, I am not sure if you can use it in python.
Kf
https://gist.GitHub.com/GoToLoop/bba0c288aaeeb5ef9bb1
https://forum.Processing.org/two/discussion/12532/windowjs-cross-mode-alert-confirm-prompt-other-js-api-for-java
Thanks guys. I ended up using a different method rather than asking for an input to achieve the same/similar result. Thanks guys for giving me the possible solutions! I hope they have better references and library for Python!