Hey all,
Im trying to have the user type in their player name and then they hit enter and it loads the array to a string but for some reason it's not working I really can't work it out im sure it's staring me in the face but i just can't crack it, please help :)
- int j;
- void setup()
- {
- size(500,500);
- }
- void draw()
- {
- }
- void keyTyped() {
- char[] name = new char[20];
- name[j] = key;
- if (keyPressed)
- {
- if( key == 'ENTER')
- {
- String player_name = new String(name);
- println(player_name);
- }
- }
- j += 1;
- }
1