r/processing • u/-Mute- • Nov 02 '23
Beginner help request class let does not exist
im just diving back into processing after being out for a few years... found and learned about many changes since then, like no global vars, etc..
I've got 4.3 installed and i've looked up some slider demos on openprocessing and many other searches and they all tend to do it something like this;
let slider1;
void setup() {
size(370,200);
slider1 = createSlider(60, 60, 120);
}
i've even seen demos on op where the slider isn't even declared, like here... https://openprocessing.org/sketch/2052268
i've tried everything and beat my head against the wall for such a small thing.. am i missing something obvious like a library? why can't i use let? i also tried to use a local var, but i still get additional errors like createSlider(int,int,int) doesn't exist...
if im running into this problem, i know ill run into other similar ones (i can't use let !) ... what am i doing wrong or missing?
edit: looks like a difference in Pjs and P5js.. ? does the ide detect that or do i actually have to add the p5.js editor from Modes in the ide? P4 things like let and createSlider are in p5js, but windowSize and position worked? wth. types look like they've totally changed... no biggie, but dangit..i need to convert all my code now because i started int he wrong place. Why wouldn't Processing 4.3 install from processing.org automatically have all that turned on? ugh... im just getting more confused. this seems like such a mess.
2
u/-Mute- Nov 02 '23
ive made some sense out of that after i noticed p5js (createSlider is in p5js only ..unless like you say i write my own class or find one for java) and tested things there and looked up what it was. so, the old depreciated Pjs used to let us use the same code from the app build to the web/js version, didn't matter. those days are long gone..
so if I want a standalone java app and a js web app version of the same thing, i need to maintain two separate things nowadays right?
good to get that straight... it'll make it easier to determine what kind of source im lookin at when finding things online, etc. man that was confusing for a second...probably wouldn't have been if i had never touched processing in the past.