Just downloaded the napplet library, installed it, fired up the first example, and it doesn't work... Where the two napplets should be is just a grey background. The code is this (though I haven't changed a thing):
import napplet.*;
NAppletManager nappletManager; PFont mainFont;
String sketchText = "A NApplet is an object that runs just like a Processing\n" + "sketch, but can run within the display space of another\n" + "sketch. The two boxes below are NApplets running in\n" + "this sketch. Notice that each will respond to the mouse\n" + "when you move the mouse pointer into its NApplet, just\n" + "as a stand-alone sketch will only respond to the mouse\n" + "when the mouse is inside its window.";
I just started learning, not just Processing, but programming as a whole, about two weeks ago. I decided rather than just following abstract examples I would set myself an actual program/application to build while I'm learning how this whole thing works. Here is the result of my first foray:
enso.
I originally made this for use with a wiimote running through Osculator, so the download includes the wii version with the Osculator file (just double click it, open the wiimote panel, and sync your wiimote) - and also requires an IR bar.
However, I decided to rewrite it for mouse and keys as well, so the download includes both versions. The mouse version works much better with an actual mouse rather than a laptop trackpad.
Here are some example 'ensos' I've created through the process of making this thing:
Enjoy!
And by all means let me know what you think. As I said, new to all this. The code is, I imagine, pretty ugly. But I managed to get it doing roughly what I wanted in the end.
Is there a way to disable the screensaver?
I'm making an app which uses the wiimote so there's no interaction from mouse or keyboard, so after a while the screensaver kicks in. Any way around this?
Once an array has been initialised at a certain size, how can you empty and change the size of the array? I'm working on this problem in a larger program, so I've written this simple bit of code to try and figure out how to do it. What I want it to do is set up an array of a particular size, and then whenever the mouse button is pressed, change the size of that array to the mouseX position. It doesn't seem to work, and I can't figure out what I'm doing wrong. Sorry, I've only been coding about two weeks...
int Asize = 100; int[] testarray = new int[Asize];
void setup() { size(400, 400); }
void draw() { }
void mousePressed() { println("The previous array size was " + testarray.length); Asize = mouseX; expand(testarray, Asize); println("The new array size is " + testarray.length); }
I want to create an array that each frame is fed the X position of the mouse, so that I can recall later on the position at a certain frame in the past. I've written the following little piece of code to test this idea, which builds an array and then prints the resulting array when it finishes a loop of 99 frames. However, when it prints the array at the end, only the final frame has a value, all the others are" 0.0".
I'm very confused, and new not only to Processing, but programming as a whole.
Any help much appreciated!
Still very new to all this, so the answer may be very simple, but I'm stuck. I'm using a Wii remote through OSCulator into Processing with the OSCp5 library. Have managed to get the accelorometers and IR feeds working, but have just tried to bring in a button for the first time and it doesn't seem to be working.
I've inserted a line to print the value of whether or not the B button (trigger) is pressed or not in the console, but regardless of whether it's pressed or not, the printed value is always "0.0"
What am I doing wrong?