I'm having a problem, but no errors neither NullPonterException...
The sketch below runs, prints all data needed and even exits correctly, but images keep stucked in the first one loaded.
The strange thing is that if you make focus on the sketch window while Processing is running and return to the screening window, you can see the whole new image or part of it, whether the sketch window was totally or partially on top of the other. Whatever, you need this action to see any changes on the screen. It was checked in three different comps.
A walk-around solution using different functions (although not optimal for other reasons) screens images correctly.
I'll appreciate any help on this. The data folder is
here.
Hi, I'm making an array of six elements printing them in random order, and I just need each element not repeating right after it's own occurrence. I've been trying booleans and looks like there should be a simple solution, but I still can't figure the combination.
I'll appreciate any reference -or the answer if its easier- that lets me know how I tell the program "next time, choose one of the rest, not what you've just printed"?
Second question: The code resulted in a random that is conditioned to the first element of the array, so the series tends to have many "zeros", and very occasionally -and at the end- one "five". Why is that happening?
I need to scale a string (a word or couple of words) to fit screen.width/screen.height no matter its actual size and proportions (I'm assuming it's going to loose them). Now, how can I get the string's size (in px) so I can make the division between the string's and screen's sizes and get the proper scale value?
I'm working on a sketch with one class, one "class extends class" and its main tag (3 tags total). Let me describe a little bit:
1. Class Particle says there is an array of 27 particles for which one letter of the alphabet is assigned to every member... and displays as animated typography.
2. Class LimitedParticle extends class Particle and tells us when each particle reaches the bottom of the screen... and rings a tone for every occurrence.
My main question:
I just can't figure out how to combine both returned datas and assign a specific sound to every member of the Class Particle. So, when "a" hits the bottom, sound "aaaa" is played. You'll find my last attempt in the code, but even if it'd worked it wouldn't be the answer, since sounds and letters would have not corresponded each other (I guess).
Secondary:
I cannot even make an array of samples with Sonia, either. It seems it understands sound file names as strings. (Gives me a "cannot convert from String to Sample")
I have a particle system in which particles are letters (from .vlw files) that fall down from the top of the screen and bounce at all bounders. It looks it's quite a RAM memory effort to bring each randerized type to the stage 30 times per second. When I call more than 5 or 7 letters, or I set their size bigger than 50, everything is clearly slower. And when I try to put a couple of paragraphs as fix text as background, or import it as .svg file, things really don't work at all.
I know I can increase max. memory available in Preferences, but it doesn't change much.
On the other hand, 27 letters displayed and moving at the same time seem to have no problem with Traer's Physics library. Why?
Could you tell me if this is normal, or maybe I'm missing a big detail about animated typography?.
I'm trying to modify an example given by Reas in Programming Handbook (sketch 50-09 / 50-10). It's a series of particles that bounce at screen bounders with physics properties.
I achieved to add one more array or single particle to the stage when I key-Press, but... I have to keep the key down all the time to see the second particle bounce altogether with the previous. So, my question is... what's the expression for extending the action permanently (I mean, after you release the key). I tried all the conditionals but I still don't figure out what the logic is. (To make a 'key touch' let me have the key free for shooting a third array and so on)
Hi, this is my first project with Processing. Sorry if questions are very basic.
I have an array with all the letters of the alphabet. They show up on the stage one by one, randomly, in random positions on certain event (currently keypress).
Now, this is what I'm stuck with:
I need every new choice to be done on the letters left (no repetitions should occur before finishing the series). When the last letter is on stage, the whole process should restart with a fully available array and an empty screen.
As you may see in the code below, the function that should subtract the letter from its array is lacking. I've been trying with "subset", "shorten" and ArrayList... and got nothing inspiring. (I cleaned all failed code to avoid confusion).
Could you give me a clue?
Second question:
I felt little ridiculous while typing 27 times the same lines for a little variation (what if it were 2300 elements instead?). What could be another way to call a specific element from an array and apply it a function without typing the function for every element?
} void draw (){ if (keyPressed == true) { int index = int(random(alfa.length)); println (alfa[index]); for (int i = 0; i < 1; i++){ if (index == 0){ text ('a',random(width) , random(height)); } if (index == 1){ text ('b',random(width) , random(height)); } if (index == 2){ text ('c',random(width) , random(height)); } if (index == 3){ text ('d',random(width) , random(height)); } if (index == 4){ text ('e',random(width) , random(height)); } if (index == 5){ text ('f',random(width) , random(height)); } if (index == 6){ text ('g',random(width) , random(height)); } if (index == 7){ text ('h',random(width) , random(height)); } if (index == 8){ text ('i',random(width) , random(height)); } if (index == 9){ text ('j',random(width) , random(height)); } if (index == 10){ text ('k',random(width) , random(height)); } if (index == 11){ text ('l',random(width) , random(height)); } if (index == 12){ text ('m',random(width) , random(height)); } if (index == 13){ text ('n',random(width) , random(height)); } if (index == 14){ text ('ñ',random(width) , random(height)); } if (index == 15){ text ('o',random(width) , random(height)); } if (index == 16){ text ('p',random(width) , random(height)); } if (index == 17){ text ('q',random(width) , random(height)); } if (index == 18){ text ('r',random(width) , random(height)); } if (index == 19){ text ('s',random(width) , random(height)); } if (index == 20){ text ('t',random(width) , random(height)); } if (index == 21){ text ('u',random(width) , random(height)); } if (index == 22){ text ('v',random(width) , random(height)); } if (index == 23){ text ('w',random(width) , random(height)); } if (index == 24){ text ('x',random(width) , random(height)); } if (index == 25){ text ('y',random(width) , random(height)); } if (index == 26){ text ('z',random(width) , random(height)); } } } }