We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all, I was wondering if there is any way one can set some default text for his new sketches. For example the setup() draw() functions so that it is not necessary to write them every time. I've looked at the preferences.txt and the different files in java mode etc but no luck...
Answers
https://GitHub.com/processing/processing/blob/master/core/src/processing/core/PApplet.java#L6099
Hi, I can't really understand your answer.
I don't know if my question is clear enough, but I'm just trying to find a way to open new sketches that will always include the following code
If you had opened the link I've posted, you'd realize "Lucida Sans" is hardcoded inside createDefaultFont(). [-(
:( Sorry but I don't understand how I can use the createDefaultFont() in order to achieve what I want... can you explain please?
Since it's hardcoded, you can't have what you want unless you recompile the whole PApplet library on your own!
Most we can do is
@Override
the original createDefaultFont() like I did in my example. 3:-OOr you can ask "them" to add in that option for ya: ~:>
https://GitHub.com/processing/processing/issues
I'm afraid I might seem impolite.... but I believe there is a misunderstanding on the subject of my question. I'm just trying to make the IDE to open every new sketch with the setup and draw functions already included as code.
Nothing to do with the fonts.
Well i found this thread forum.processing.org/one/topic/initsketch-extension-tool.html but none of the links work, as far as I can tell the developer abandoned the tools. Sad. At least if anyone knows what has to be tweaked and where ... :\
Anyway, thank's a lot for your help!
I've found their updated version to Processing 2.2.1 in his GitHub:
https://GitHub.com/poifox/processing-tools/releases
But it's in source code form and still needs to be manually built & compiled as a ".jar". 8-X
You could do something close enough with system wide text substitution tools like texter. These allow you to define shortcuts that are automatically expanded to any string. So for example you might just type
}sketch
to get the boiler plate...I have a little post-it notes app an my laptop, useful for holding code snippets. Would be ideal for this. Easier than digging around in the filesystem for a file.
(But yes, it's a pain. I understand immediate mode was more common in earlier versions so not everything had a setup and a draw but surely it's easier to delete something you don't want than add something you do)
(Could easily also be a menu option)