Loading...
Logo
Processing Forum
hammerhans's Profile
2 Posts
0 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    Hello community,

    In my sketch there are some objects, which can be moved forward and backwards. 
    There are alltogether 94 objects. I limited them, so there are only 20 objects shown on the screen. If you scroll forward, new ones fade in, old ones fade out. 

    I want them to get brighter, depending on how near they are to the viewer/screen.
    The program looks like this:






    Does anyone have an idea how to do this?
    In my sketch I've imported a .txt file

    1. void information() {
        String[] lines = loadStrings("text.txt"); 
        for (int i=0; i < lines.length; i++) {
          float categorie, year, information;
          String[] values = split(lines[i], '\t');  
          txt[i][0] = values[0].trim(); // kategorie
          txt[i][1] = values[1].trim(); // jahr            
          txt[i][2] = values[2].trim(); // informationen
        }
      }

    The lines are splitted with Tabs \t.

    I want to print out the text with some new lines in it. 

    The structure of the txt file is for example:


    1. g      1982      Hello text text text. \n More text more text more text.


    If I print it out (PFont), the text doesn't show up in a new line, it only shows both sentences and the \n in one line.

    How can I get a line break in an imported txt file?