Loading...
Logo
Processing Forum
Hello,

I am new to processing and android and am having trouble getting started with my idea.  I'm trying to make a sketch that is interactive that would allow the user to type something into a textbox widget (i.e., circle, square, etc.) and then processing would draw the shape based on the user's input.

I'm sure this is very easy to do, I just don't know where to even start.  I've tried to find examples and cannot find anything related to what I'm trying to do.

Any help you can give would be greatly appreciated.

Rgds,
Scott

Replies(2)

Hi Scott,

Just break it down into steps... 

Can you get the textbox widget to work properly? (ie. run an Android sketch on the emulator or device)

Can you test the resulting string against strings like "circle" or "square" ?? (ie. test the equality of a string)

Can you draw a circle or a square if they are equal? (Im sure you can figure that part out...  )
Hi Jesse,

Yes, the textbox widget is displaying in my sketch.  But it is not doing what I want.  The draw method is getting run without considering what is input into the widget.

Basically, all I want to do is draw something based on what is input into the widget.  I don't know the syntax or where to start and am looking for some help with a few lines of code to build on.

Does the draw method get executed automatically or can you have it wait until a button is pressed or something input into the text box first?  If so, should I put the draw method inside a try, catch, fail statement or is there a better way?

If you could share a quick 5-10 line example of code (if what I'm trying to do can fit in something that short) I would greatly appreciate it.

Rgds,
Scott