program tabs

edited June 2014 in How To...

Hi, Could someone please point me in the right direction. 1) How can I possibly devide my programm into several parts and make one part launch the second (or at least a function from the second part) from a different tab. 2) Is there a way to store images for my program NOT in the folder with the initital program (I want to create separate sub folders for different pictures)

Thank you all, Alex

Tagged:

Answers

  • Answer ✓
    1. It doesn't matter which tab a function resides. If it's not in a class, it can be called from any tab!
    2. Use dataPath("/pics/pic43.jpg"), dataPath("/sound/fx54.mp3").
  • It has been a year, but still thank you)

  • One year? So this forum shows "June 5" without indicating it was in 2013?!

  • Wait, I knew this forum opened in November 2013... before that was another forum. I wasn't there when the change has been made, but...

  • Mmm, no, my sticky was created in the early days of the forum (before it was public...) and displays correctly "October 2013".

  • While we are on the same topic, does it mean I can't create a class in one tab, and then use it to initialize objets in another?

  • All ".pde" tabs are merged together! So they all behave as 1 "top-class"! :-B

  • Sorry, I don't understand what is a "top class".

  • edited July 2014

    A top class is a non-nested class! In Java all code is inside some class.
    A nested class is a class inside another class.

    What Processing does is wrap up all ".pde" tabs as 1 top-class.
    Even our own classes, which then become nested 1s!

  • edited July 2014

    "does it mean I can't create a class in one tab, and then use it to initialize objets in another?"
    Not at all. You can do that alright.
    As said, tabs are only a way to organize things, but behind the scene, the sketch behaves as if all the code was in a single run in the same file.
    That's what GoToLoop said, just stated differently to emphasize the point... :-)

  • Much clearer now, thanks for all the trouble :) Couldn't understand it at first.

Sign In or Register to comment.