|
Author |
Topic: processing "debugger" ?? (Read 3261 times) |
|
lunetta
|
processing "debugger" ??
« on: Apr 2nd, 2005, 11:14pm » |
|
Hi I'm wondering if there's any flash-style debugger for java that I could use with processing; The idea is to have a window with variables and property values being watched at runtime... It would be really useful to check what's happening without having to add a println everywhere in the code... Does something like this exist and is possible or am I dreaming?
|
|
|
|
mflux
|
Re: processing "debugger" ??
« Reply #1 on: Apr 3rd, 2005, 5:21am » |
|
I'm guessing Ben won't add this because he's busy with other stuff (GL, etc) and will just tell you to use your own IDE. However, I usually run into this problem too of wanting to see my variables but not wanting to do println all the time. Here are a few tricks: You can use a step timer and the enum operator (%) to only check variables every 10 steps, or 100 steps, etc. That way it won't be a crazy stream of printlns. You can also check variables only on mouseReleased or mousePressed. That way it'll only check a variable when you want to check it. You can also extend or write your own println() functions that take two values at a time. Say you want a println for both x and y, you can simply write a printPoint() function that takes 2 floats and println them nicely formatted like: description(x,y) Finally, you can also write your own neat debugger UI which prints important variables. Sure it's time consuming for smaller projects, but for bigger projects it becomes invaluable. Do this using the text() command, and you can also clip values using nf(). I know these are nasty workarounds but in general processing sketches don't ever get insanely huge to demand a full time ide-debugger or variable trace.
|
« Last Edit: Apr 3rd, 2005, 5:23am by mflux » |
|
|
|
|
kurol
|
Re: processing "debugger" ??
« Reply #2 on: Apr 4th, 2005, 12:59pm » |
|
in terms of neat UIs, one thing i did was make a quick function that superimposed rectangles with widths/heights corresponding to a variable. Code:void forcebar(int x,int y, float f) { rect(x,y,f,5); } |
| nice because you can have negative corner displacements too... If you were fancy, you could add color and alpha.
|
I hate programming . . .
|
|
|
mflux
|
Re: processing "debugger" ??
« Reply #3 on: Apr 4th, 2005, 2:29pm » |
|
Yummy. But in some cases it would be even better if you could specify a set width of the bar, and have the f be a percentage of the total like so: Code: void forcebar(int x,int y, float w, float f,float max) { rect(x,y,(f/max)*w,5); } |
|
|
|
|
|
lunetta
|
Re: processing "debugger" ??
« Reply #4 on: Apr 4th, 2005, 7:41pm » |
|
nice, thanks. I guess I do some stuff like this, even simpler. IT's just a *pain* when the sketch is big and you have no idea where a problem can be...
|
|
|
|
fry
|
Re: processing "debugger" ??
« Reply #5 on: Apr 4th, 2005, 7:48pm » |
|
yeah, a better debugger is something we'd like, especially for our target audience, but just haven't been able to do (and it's not on the board for 1.0)
|
|
|
|
|