├── ISSUE_TEMPLATE.md ├── test ├── unit │ ├── webgl │ │ ├── matrix.js │ │ └── p5.RendererGL.js │ └── assets │ │ ├── acmesa.ttf │ │ ├── object.json │ │ ├── target.gif │ │ ├── nyan_cat.gif │ │ ├── renders │ │ ├── line.png │ │ ├── random.png │ │ ├── test.png │ │ ├── test1.png │ │ ├── test2.png │ │ └── ellipse.png │ │ ├── target_small.gif │ │ ├── csv.csv │ │ └── array.json ├── manual-test-examples │ ├── loadingscreen │ │ ├── test.json │ │ ├── test.xml │ │ ├── invalid.json │ │ ├── banana.png │ │ ├── mammals.csv │ │ ├── test.txt │ │ ├── AvenirNextLTPro-Demi.otf │ │ ├── invalid_json.js │ │ ├── invalid_json.html │ │ └── preload_success_callbacks.html │ ├── p5.Shape │ │ └── test0 │ │ │ ├── sketch.js │ │ │ ├── index.html │ │ │ └── circle.svg │ ├── async │ │ ├── loadTable_options │ │ │ ├── table.csv │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── loadTable_callback │ │ │ ├── table.csv │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── loadTable_preload │ │ │ ├── table.csv │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── loadImage │ │ │ ├── global │ │ │ │ ├── test.gif │ │ │ │ └── index.html │ │ │ └── instance │ │ │ │ ├── test.gif │ │ │ │ └── index.html │ │ ├── loadFont │ │ │ ├── global │ │ │ │ ├── acmesa.ttf │ │ │ │ ├── SourceSansPro-Regular.otf │ │ │ │ └── index.html │ │ │ └── instance │ │ │ │ ├── acmesa.ttf │ │ │ │ ├── test.gif │ │ │ │ ├── SourceSansPro-Regular.otf │ │ │ │ └── index.html │ │ ├── loadJSON_options │ │ │ ├── sketch.js │ │ │ └── index.html │ │ ├── loadJSON_preload │ │ │ └── index.html │ │ ├── loadXML_preload │ │ │ └── index.html │ │ ├── loadStrings_callback │ │ │ ├── index.html │ │ │ └── tenderbuttons_excerpt.txt │ │ ├── loadStrings_preload │ │ │ ├── index.html │ │ │ └── tenderbuttons_excerpt.txt │ │ └── loadJSON_callback │ │ │ └── index.html │ ├── p5.Image │ │ ├── cat.jpg │ │ ├── unicorn.jpg │ │ ├── running-cat.png │ │ ├── sprite_sheet.jpg │ │ ├── african-savanna.png │ │ ├── cat-with-alpha.png │ │ ├── filter.html │ │ ├── saving.html │ │ ├── animate.html │ │ ├── copying.html │ │ ├── cropping.html │ │ ├── drawing.html │ │ ├── manipulate.html │ │ ├── saving-images.js │ │ ├── animate-image.js │ │ └── copying-images.js │ ├── tint │ │ ├── flowers.jpg │ │ ├── index.html │ │ └── sketch.js │ ├── p5.Font │ │ ├── acmesa.ttf │ │ ├── Lato-Black.ttf │ │ ├── FiraSans-Book.otf │ │ ├── Inconsolata-Bold.ttf │ │ ├── OpenSans-Regular.ttf │ │ ├── custom │ │ │ ├── textSketch.png │ │ │ ├── LEFT.BL.lead.png │ │ │ ├── LEFT.TOP.lead.png │ │ │ ├── textAlignSketch.png │ │ │ ├── textLineSketch.png │ │ │ ├── textSizeSketch.png │ │ │ ├── textWidthSketch.png │ │ │ ├── textWrapSketch.png │ │ │ ├── LEFT.BOTTOM.lead.png │ │ │ ├── LEFT.CENTER.lead.png │ │ │ ├── textOverlapSketch.png │ │ │ ├── textAlignmentSketch.png │ │ │ └── textVertAlignmentSketch.png │ │ ├── system │ │ │ ├── textSketch.png │ │ │ ├── LEFT.BL.lead.png │ │ │ ├── LEFT.TOP.lead.png │ │ │ ├── textAlignSketch.png │ │ │ ├── textLineSketch.png │ │ │ ├── textSizeSketch.png │ │ │ ├── textWidthSketch.png │ │ │ ├── textWrapSketch.png │ │ │ ├── LEFT.BOTTOM.lead.png │ │ │ ├── LEFT.CENTER.lead.png │ │ │ ├── textOverlapSketch.png │ │ │ └── textAllAlignmentsSketch.png │ │ ├── Montserrat-Regular.ttf │ │ ├── SourceSansPro-Bold.ttf │ │ ├── SourceSansPro-Italic.ttf │ │ ├── SourceSansPro-Regular.otf │ │ ├── Merriweather-LightItalic.ttf │ │ ├── PlayfairDisplay-Regular.ttf │ │ ├── opentype │ │ │ ├── AvenirNextLTPro-Demi.otf │ │ │ └── index.html │ │ ├── style │ │ │ ├── sketch.js │ │ │ └── index.html │ │ ├── svgpath │ │ │ └── index.html │ │ ├── renderpath │ │ │ └── index.html │ │ ├── pathpoints │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── callback │ │ │ ├── sketch.js │ │ │ └── index.html │ │ └── simple │ │ │ └── index.html │ ├── pixel │ │ ├── unicorn.jpg │ │ ├── set-pixels.html │ │ ├── update-pixels.html │ │ └── set-pixels.js │ ├── env │ │ └── cursor │ │ │ ├── banana.png │ │ │ └── index.html │ ├── mouse-events │ │ ├── fingers.mov │ │ ├── global-mousex │ │ │ ├── sketch.js │ │ │ └── index.html │ │ ├── global-mousex-offset │ │ │ ├── sketch.js │ │ │ └── index.html │ │ ├── instance-mousex-css │ │ │ └── sketch.js │ │ ├── instance-mousex │ │ │ ├── sketch.js │ │ │ └── index.html │ │ └── instance-mousex-offset │ │ │ ├── sketch.js │ │ │ └── index.html │ ├── addons │ │ ├── p5.dom │ │ │ ├── fingers.mov │ │ │ ├── fingers.webm │ │ │ ├── lucky_dragons_-_power_melody.mp3 │ │ │ ├── lucky_dragons_-_power_melody.ogg │ │ │ ├── capture_audio │ │ │ │ ├── sketch.js │ │ │ │ └── index.html │ │ │ ├── audioelt_onended │ │ │ │ ├── sketch.js │ │ │ │ └── index.html │ │ │ ├── video_to_canvas │ │ │ │ ├── sketch.js │ │ │ │ └── index.html │ │ │ ├── capture_video │ │ │ │ ├── sketch.js │ │ │ │ └── index.html │ │ │ ├── radio_test │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── dropdown_test │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── global │ │ │ │ └── index.html │ │ │ ├── input_button │ │ │ │ └── index.html │ │ │ ├── slider_button │ │ │ │ └── index.html │ │ │ ├── slider_tests │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── video_button │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── video_circles │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── video_pixels │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── video_scrub │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── video_speed │ │ │ │ └── index.html │ │ │ ├── brightness_mirror │ │ │ │ └── index.html │ │ │ ├── capture_video_sizing │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ ├── audioEltSpotify │ │ │ │ └── index.html │ │ │ ├── instance │ │ │ │ └── index.html │ │ │ ├── checkbox_test │ │ │ │ └── index.html │ │ │ ├── audio_button_slider │ │ │ │ └── index.html │ │ │ ├── audioEltSpotifyCrossOrigin │ │ │ │ └── index.html │ │ │ ├── file_input │ │ │ │ ├── index.html │ │ │ │ └── sketch.js │ │ │ └── file_input_div │ │ │ │ └── index.html │ │ └── p5.sound │ │ │ ├── _files │ │ │ ├── beat.mp3 │ │ │ ├── beat.ogg │ │ │ ├── drum.mp3 │ │ │ ├── drum.ogg │ │ │ ├── beatbox.mp3 │ │ │ ├── beatbox.ogg │ │ │ ├── bx-spring.mp3 │ │ │ ├── bx-spring.ogg │ │ │ ├── doorbell.mp3 │ │ │ ├── doorbell.ogg │ │ │ ├── studio-b.mp3 │ │ │ ├── studio-b.ogg │ │ │ ├── small-plate.mp3 │ │ │ ├── small-plate.ogg │ │ │ ├── concrete-tunnel.mp3 │ │ │ ├── concrete-tunnel.ogg │ │ │ ├── large-dark-plate.mp3 │ │ │ ├── large-dark-plate.ogg │ │ │ ├── Damscray_-_Dancing_Tiger_01.mp3 │ │ │ ├── Damscray_-_Dancing_Tiger_01.ogg │ │ │ ├── Damscray_-_Dancing_Tiger_02.mp3 │ │ │ ├── Damscray_-_Dancing_Tiger_02.ogg │ │ │ ├── lucky_dragons_-_power_melody.mp3 │ │ │ └── lucky_dragons_-_power_melody.ogg │ │ │ ├── micLevel │ │ │ ├── sketch.js │ │ │ └── index.html │ │ │ ├── PulseFFT │ │ │ └── index.html │ │ │ ├── envelope │ │ │ └── index.html │ │ │ ├── micFFT │ │ │ ├── index.html │ │ │ └── sketch.js │ │ │ ├── record │ │ │ └── index.html │ │ │ ├── waveform │ │ │ └── index.html │ │ │ ├── DelaySoundFile │ │ │ └── index.html │ │ │ ├── FFT_freqRange │ │ │ └── index.html │ │ │ ├── FFT_waveform │ │ │ └── index.html │ │ │ ├── FFT_waveform_2 │ │ │ └── index.html │ │ │ ├── Filter_LowPass │ │ │ └── index.html │ │ │ ├── Reverb_basic │ │ │ ├── index.html │ │ │ └── sketch.js │ │ │ ├── envelopeOnOff │ │ │ └── index.html │ │ │ ├── looper_simple │ │ │ └── index.html │ │ │ ├── noiseMod_AM │ │ │ └── index.html │ │ │ ├── outOfPhase │ │ │ └── index.html │ │ │ ├── pan_soundfile │ │ │ └── index.html │ │ │ ├── peakDetect │ │ │ └── index.html │ │ │ ├── play_soundfile │ │ │ └── index.html │ │ │ ├── playbackRate │ │ │ └── index.html │ │ │ ├── recordLoops │ │ │ └── index.html │ │ │ ├── soundFormats │ │ │ └── index.html │ │ │ ├── DelayNoiseEnvelope │ │ │ └── index.html │ │ │ ├── Filter_BandPass │ │ │ └── index.html │ │ │ ├── Reverb_convolve │ │ │ └── index.html │ │ │ ├── Reverb_convolve_FFT │ │ │ └── index.html │ │ │ ├── amplitude_analysis │ │ │ └── index.html │ │ │ ├── autoCorrelation │ │ │ └── index.html │ │ │ ├── loadSound_callback │ │ │ └── index.html │ │ │ ├── loadSound_preload │ │ │ └── index.html │ │ │ ├── micLevel_on_off │ │ │ └── index.html │ │ │ ├── oscillatorMod_AM │ │ │ └── index.html │ │ │ ├── oscillatorMod_FM │ │ │ └── index.html │ │ │ ├── oscillatorWaveform │ │ │ └── index.html │ │ │ ├── oscillator_FMSynth │ │ │ └── index.html │ │ │ ├── pause_soundfile │ │ │ ├── index.html │ │ │ └── sketch.js │ │ │ ├── peakDetect_basic │ │ │ └── index.html │ │ │ ├── soundfileMod_AM │ │ │ └── index.html │ │ │ ├── soundfile_playMode │ │ │ └── index.html │ │ │ ├── FFT_frequency_spectrum │ │ │ └── index.html │ │ │ ├── oscillatorSecondsFromNow │ │ │ ├── index.html │ │ │ └── sketch.js │ │ │ ├── waveform_with_playhead │ │ │ └── index.html │ │ │ └── waveform_peaks_with_playhead │ │ │ └── index.html │ ├── tutorials │ │ ├── DOM-extensions │ │ │ ├── 0 │ │ │ │ └── index.html │ │ │ ├── 1 │ │ │ │ └── index.html │ │ │ ├── 2 │ │ │ │ └── index.html │ │ │ ├── 3 │ │ │ │ └── index.html │ │ │ ├── 4 │ │ │ │ └── index.html │ │ │ ├── 5 │ │ │ │ └── index.html │ │ │ ├── 6 │ │ │ │ └── index.html │ │ │ ├── 7 │ │ │ │ └── index.html │ │ │ ├── 8 │ │ │ │ └── index.html │ │ │ ├── dom_1.png │ │ │ ├── dom_5.png │ │ │ ├── dom_7.png │ │ │ ├── dom_8.png │ │ │ ├── dom_2-0.png │ │ │ └── dom_2-1.png │ │ └── Integrating-other-libraries │ │ │ ├── 0 │ │ │ ├── rhodes_loop.wav │ │ │ └── index.html │ │ │ ├── 1 │ │ │ ├── red.jpg │ │ │ ├── rhodes_loop.wav │ │ │ └── index.html │ │ │ └── 2 │ │ │ ├── red.jpg │ │ │ ├── rhodes_loop.wav │ │ │ └── index.html │ ├── webgl │ │ ├── material │ │ │ ├── texture │ │ │ │ └── assets │ │ │ │ │ ├── cat.jpg │ │ │ │ │ ├── UV_Grid_Lg.jpg │ │ │ │ │ ├── UV_Grid_Sm.jpg │ │ │ │ │ ├── UV_Grid_Med.jpg │ │ │ │ │ ├── tiny_grid_@2X.png │ │ │ │ │ └── 360video_256crop_v2.mp4 │ │ │ └── simple │ │ │ │ └── sketch.js │ │ ├── lights │ │ │ ├── ambientLight │ │ │ │ └── sketch.js │ │ │ ├── pointLight │ │ │ │ └── sketch.js │ │ │ ├── directionalLight │ │ │ │ └── sketch.js │ │ │ └── multipleLights │ │ │ │ └── sketch.js │ │ ├── mobile │ │ │ └── sketch.js │ │ ├── camera │ │ │ ├── ortho │ │ │ │ └── sketch.js │ │ │ └── perspective │ │ │ │ └── sketch.js │ │ ├── interaction │ │ │ └── sketch.js │ │ ├── performance │ │ │ └── sketch.js │ │ ├── origin │ │ │ ├── topleft_origin │ │ │ │ └── sketch.js │ │ │ └── center_origin │ │ │ │ └── sketch.js │ │ └── mixedMode │ │ │ └── sketch.js │ ├── empty-example │ │ ├── sketch.js │ │ └── index.html │ ├── instantiation-global │ │ ├── case3 │ │ │ ├── sketch.js │ │ │ └── index.html │ │ ├── case1 │ │ │ ├── sketch.js │ │ │ └── index.html │ │ ├── case2 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── case4 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── case5 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ └── case6 │ │ │ ├── index.html │ │ │ └── sketch.js │ ├── instantiation-instance │ │ ├── case0 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── case1 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── case5 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── case4 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── case3 │ │ │ ├── index.html │ │ │ └── sketch.js │ │ └── case6 │ │ │ └── index.html │ ├── learningprocessing │ │ ├── chp1 │ │ │ ├── index.html │ │ │ ├── example_1_1.js │ │ │ ├── example_1_2.js │ │ │ ├── example_1_3.js │ │ │ ├── example_1_5.js │ │ │ └── example_1_4.js │ │ ├── chp2 │ │ │ └── index.html │ │ ├── chp3 │ │ │ ├── index.html │ │ │ ├── example_3_4.js │ │ │ ├── example_3_2.js │ │ │ └── example_3_5.js │ │ ├── chp4 │ │ │ ├── index.html │ │ │ ├── example_4_2.js │ │ │ ├── example_4_5.js │ │ │ ├── example_4_3.js │ │ │ └── example_4_6.js │ │ ├── chp5 │ │ │ └── index.html │ │ ├── chp6 │ │ │ ├── index.html │ │ │ ├── example_6_6.js │ │ │ ├── example_6_1.js │ │ │ ├── example_6_4.js │ │ │ ├── example_6_3.js │ │ │ └── example_6_8.js │ │ ├── chp7 │ │ │ ├── index.html │ │ │ ├── example_7_1.js │ │ │ └── example_7_2.js │ │ ├── chp8 │ │ │ └── index.html │ │ ├── chp9 │ │ │ ├── index.html │ │ │ ├── example_9_6.js │ │ │ ├── example_9_3.js │ │ │ ├── example_9_5.js │ │ │ ├── example_9_7.js │ │ │ ├── example_9_4.js │ │ │ └── example_9_2.js │ │ └── chp10 │ │ │ ├── example_10_4 │ │ │ ├── index.html │ │ │ └── example_10_4.js │ │ │ ├── example_10_6 │ │ │ ├── index.html │ │ │ └── example_10_6.js │ │ │ ├── example_10_8 │ │ │ ├── index.html │ │ │ └── example_10_8.js │ │ │ ├── example_10_2 │ │ │ ├── index.html │ │ │ └── example_10_2.js │ │ │ ├── example_10_3 │ │ │ └── index.html │ │ │ ├── example_10_5 │ │ │ ├── index.html │ │ │ └── example_10_5.js │ │ │ ├── example_10_7 │ │ │ └── index.html │ │ │ ├── example_10_1 │ │ │ ├── index.html │ │ │ ├── catcher.js │ │ │ └── example_10_1.js │ │ │ ├── example_10_10 │ │ │ └── index.html │ │ │ └── example_10_9 │ │ │ ├── index.html │ │ │ └── catcher.js │ ├── saveData │ │ ├── saveStrings │ │ │ ├── sketch.js │ │ │ └── index.html │ │ ├── saveJSONArray │ │ │ └── index.html │ │ └── saveJSONObject │ │ │ ├── index.html │ │ │ └── sketch.js │ ├── keyboard │ │ ├── gamestyle.html │ │ ├── keyIsPressed.html │ │ ├── gamestyle.js │ │ └── keyIsPressed.js │ ├── p5.Table │ │ ├── saveTable │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── trim │ │ │ └── index.html │ │ ├── findRows │ │ │ └── index.html │ │ ├── getColumn │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── getObject │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── matchRow │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── matchRows │ │ │ └── index.html │ │ └── removeTokens │ │ │ └── index.html │ ├── p5.Vector │ │ ├── NOC_2_7_attraction_many │ │ │ └── index.html │ │ ├── NOC_2_5_fluidresistance │ │ │ └── index.html │ │ └── NOC_6_09_Flocking │ │ │ ├── index.html │ │ │ └── flock.js │ └── module.html └── .jshintrc ├── .jscsrc ├── docs ├── yuidoc-p5-theme │ ├── assets │ │ ├── Bold.ttf │ │ ├── beat.mp3 │ │ ├── beat.ogg │ │ ├── drum.mp3 │ │ ├── drum.ogg │ │ ├── mask.png │ │ ├── mask2.png │ │ ├── Avenir.otf │ │ ├── Italic.ttf │ │ ├── Regular.otf │ │ ├── beatbox.mp3 │ │ ├── beatbox.ogg │ │ ├── bricks.jpg │ │ ├── doorbell.mp3 │ │ ├── doorbell.ogg │ │ ├── fingers.mov │ │ ├── moonwalk.jpg │ │ ├── rockies.jpg │ │ ├── studio-b.mp3 │ │ ├── studio-b.ogg │ │ ├── bx-spring.mp3 │ │ ├── bx-spring.ogg │ │ ├── laDefense.jpg │ │ ├── mammals.csv │ │ ├── bricks_third.jpg │ │ ├── small-plate.mp3 │ │ ├── small-plate.ogg │ │ ├── concrete-tunnel.mp3 │ │ ├── concrete-tunnel.ogg │ │ ├── large-dark-plate.mp3 │ │ ├── large-dark-plate.ogg │ │ ├── AvenirNextLTPro-Demi.otf │ │ ├── Damscray_DancingTiger.mp3 │ │ ├── Damscray_DancingTiger.ogg │ │ ├── test.txt │ │ ├── Damscray_-_Dancing_Tiger_01.mp3 │ │ ├── Damscray_-_Dancing_Tiger_01.ogg │ │ ├── Damscray_-_Dancing_Tiger_02.mp3 │ │ ├── Damscray_-_Dancing_Tiger_02.ogg │ │ ├── lucky_dragons_-_power_melody.mp3 │ │ ├── lucky_dragons_-_power_melody.ogg │ │ └── mammals.xml │ └── helpers │ │ ├── helpers_prod.js │ │ └── helpers_dev.js └── yuidoc-p5-theme-src │ └── scripts │ ├── tpl │ ├── search.html │ ├── search_suggestion.html │ └── list.html │ └── .jshintrc ├── .travis.yml ├── src ├── webgl │ ├── shaders │ │ ├── vertexColor.frag │ │ ├── normal.frag │ │ ├── basic.frag │ │ ├── vertexColor.vert │ │ ├── immediate.vert │ │ ├── normal.vert │ │ └── light_texture.frag │ └── interaction.js ├── math │ └── polargeometry.js └── .jshintrc ├── lib └── .gitkeep ├── .gitignore ├── .jshintrc └── .editorconfig /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/unit/webgl/matrix.js: -------------------------------------------------------------------------------- 1 | //@TODO -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 1 3 | } -------------------------------------------------------------------------------- /.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "disallowTrailingWhitespace": true, 3 | "validateIndentation": 2 4 | } 5 | -------------------------------------------------------------------------------- /test/unit/assets/acmesa.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/acmesa.ttf -------------------------------------------------------------------------------- /test/unit/assets/object.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 0, 3 | "species": "Panthera leo", 4 | "name": "Lion" 5 | } -------------------------------------------------------------------------------- /test/unit/assets/target.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/target.gif -------------------------------------------------------------------------------- /test/unit/assets/nyan_cat.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/nyan_cat.gif -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 2 4 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Shape/test0/sketch.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | 3 | } 4 | 5 | function draw() { 6 | 7 | } -------------------------------------------------------------------------------- /test/unit/assets/renders/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/renders/line.png -------------------------------------------------------------------------------- /test/unit/assets/renders/random.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/renders/random.png -------------------------------------------------------------------------------- /test/unit/assets/renders/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/renders/test.png -------------------------------------------------------------------------------- /test/unit/assets/renders/test1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/renders/test1.png -------------------------------------------------------------------------------- /test/unit/assets/renders/test2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/renders/test2.png -------------------------------------------------------------------------------- /test/unit/assets/target_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/target_small.gif -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Bold.ttf -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/beat.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/beat.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/beat.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/beat.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/drum.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/drum.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/drum.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/drum.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/mask.png -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/mask2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/mask2.png -------------------------------------------------------------------------------- /test/unit/assets/csv.csv: -------------------------------------------------------------------------------- 1 | name,age,height 2 | David,31,80 3 | "David, Jr.",11,61.5 4 | "David, 5 | Sr. ""the boss""",95,88 -------------------------------------------------------------------------------- /test/unit/assets/renders/ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/unit/assets/renders/ellipse.png -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Avenir.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Avenir.otf -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Italic.ttf -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Regular.otf -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/beatbox.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/beatbox.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/beatbox.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/beatbox.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/bricks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/bricks.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/doorbell.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/doorbell.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/doorbell.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/doorbell.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/fingers.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/fingers.mov -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/moonwalk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/moonwalk.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/rockies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/rockies.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/studio-b.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/studio-b.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/studio-b.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/studio-b.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/invalid.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | 'a':"foo" 4 | }, 5 | { 6 | 'a':"bar" 7 | } 8 | ] -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/bx-spring.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/bx-spring.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/bx-spring.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/bx-spring.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/laDefense.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/laDefense.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/mammals.csv: -------------------------------------------------------------------------------- 1 | id,species,name 2 | 0,Capra hircus,Goat 3 | 1,Panthera pardus,Leopard 4 | 2,Equus zebra,Zebra -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_options/table.csv: -------------------------------------------------------------------------------- 1 | 0 Capra hircus Goat 2 | 1 Panthera pardus Leopard 3 | 2 Equus zebra Zebra -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Image/cat.jpg -------------------------------------------------------------------------------- /test/manual-test-examples/tint/flowers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tint/flowers.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/bricks_third.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/bricks_third.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/small-plate.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/small-plate.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/small-plate.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/small-plate.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/acmesa.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/acmesa.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/pixel/unicorn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/pixel/unicorn.jpg -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4.2" 4 | - "5.1" 5 | install: npm install 6 | script: npm run grunt 7 | sudo: false 8 | -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/concrete-tunnel.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/concrete-tunnel.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/concrete-tunnel.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/concrete-tunnel.ogg -------------------------------------------------------------------------------- /src/webgl/shaders/vertexColor.frag: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec4 vColor; 3 | void main(void) { 4 | gl_FragColor = vColor; 5 | } -------------------------------------------------------------------------------- /test/manual-test-examples/env/cursor/banana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/env/cursor/banana.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/unicorn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Image/unicorn.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/large-dark-plate.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/large-dark-plate.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/large-dark-plate.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/large-dark-plate.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/banana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/loadingscreen/banana.png -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/mammals.csv: -------------------------------------------------------------------------------- 1 | id,species,name 2 | 0,Capra hircus,Goat 3 | 1,Panthera pardus,Leopard 4 | 2,Equus zebra,Zebra -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/fingers.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/mouse-events/fingers.mov -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/Lato-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/Lato-Black.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/running-cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Image/running-cat.png -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/AvenirNextLTPro-Demi.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/AvenirNextLTPro-Demi.otf -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/fingers.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.dom/fingers.mov -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/fingers.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.dom/fingers.webm -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_callback/table.csv: -------------------------------------------------------------------------------- 1 | id,species,name 2 | 0,Capra hircus,Goat 3 | 1,Panthera pardus,Leopard 4 | 2,Equus zebra,Zebra -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_preload/table.csv: -------------------------------------------------------------------------------- 1 | id,species,name 2 | 0,Capra hircus,Goat 3 | 1,Panthera pardus,Leopard 4 | 2,Equus zebra,Zebra -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/FiraSans-Book.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/FiraSans-Book.otf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/sprite_sheet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Image/sprite_sheet.jpg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Damscray_DancingTiger.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Damscray_DancingTiger.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Damscray_DancingTiger.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Damscray_DancingTiger.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/test.txt: -------------------------------------------------------------------------------- 1 | I am a cat 2 | I like apples 3 | I have three feet 4 | I like my nose 5 | I smell like butter 6 | I talk like an orange -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/african-savanna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Image/african-savanna.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/cat-with-alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Image/cat-with-alpha.png -------------------------------------------------------------------------------- /src/webgl/shaders/normal.frag: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec3 vVertexNormal; 3 | void main(void) { 4 | gl_FragColor = vec4(vVertexNormal, 1.0); 5 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/beat.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/beat.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/beat.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/beat.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/drum.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/drum.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/drum.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/drum.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadImage/global/test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/async/loadImage/global/test.gif -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/Montserrat-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/Montserrat-Regular.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/SourceSansPro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/SourceSansPro-Bold.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/LEFT.BL.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/LEFT.BL.lead.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/LEFT.BL.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/LEFT.BL.lead.png -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_01.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_01.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_01.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_01.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_02.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_02.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_02.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/Damscray_-_Dancing_Tiger_02.ogg -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/lucky_dragons_-_power_melody.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/lucky_dragons_-_power_melody.mp3 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/lucky_dragons_-_power_melody.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/docs/yuidoc-p5-theme/assets/lucky_dragons_-_power_melody.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/beatbox.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/beatbox.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/beatbox.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/beatbox.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadFont/global/acmesa.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/async/loadFont/global/acmesa.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadFont/instance/acmesa.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/async/loadFont/instance/acmesa.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadFont/instance/test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/async/loadFont/instance/test.gif -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadImage/instance/test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/async/loadImage/instance/test.gif -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/test.txt: -------------------------------------------------------------------------------- 1 | I am a cat 2 | I like apples 3 | I have three feet 4 | I like my nose 5 | I smell like butter 6 | I talk like an orange -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/SourceSansPro-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/SourceSansPro-Italic.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/LEFT.TOP.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/LEFT.TOP.lead.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textAlignSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textAlignSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textLineSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textLineSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textSizeSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textSizeSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textWidthSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textWidthSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textWrapSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textWrapSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/LEFT.TOP.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/LEFT.TOP.lead.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textAlignSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textAlignSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textLineSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textLineSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textSizeSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textSizeSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textWidthSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textWidthSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textWrapSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textWrapSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/dom_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/DOM-extensions/dom_1.png -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/dom_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/DOM-extensions/dom_5.png -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/dom_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/DOM-extensions/dom_7.png -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/dom_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/DOM-extensions/dom_8.png -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/bx-spring.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/bx-spring.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/bx-spring.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/bx-spring.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/doorbell.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/doorbell.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/doorbell.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/doorbell.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/studio-b.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/studio-b.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/studio-b.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/studio-b.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/Merriweather-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/Merriweather-LightItalic.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/PlayfairDisplay-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/PlayfairDisplay-Regular.ttf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/LEFT.BOTTOM.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/LEFT.BOTTOM.lead.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/LEFT.CENTER.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/LEFT.CENTER.lead.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textOverlapSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textOverlapSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/LEFT.BOTTOM.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/LEFT.BOTTOM.lead.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/LEFT.CENTER.lead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/LEFT.CENTER.lead.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textOverlapSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textOverlapSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/dom_2-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/DOM-extensions/dom_2-0.png -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/dom_2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/DOM-extensions/dom_2-1.png -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/small-plate.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/small-plate.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/small-plate.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/small-plate.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/AvenirNextLTPro-Demi.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/loadingscreen/AvenirNextLTPro-Demi.otf -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textAlignmentSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textAlignmentSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/material/texture/assets/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/webgl/material/texture/assets/cat.jpg -------------------------------------------------------------------------------- /src/webgl/shaders/basic.frag: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec3 vVertexNormal; 3 | uniform vec4 uMaterialColor; 4 | void main(void) { 5 | gl_FragColor = uMaterialColor; 6 | } -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/opentype/AvenirNextLTPro-Demi.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/opentype/AvenirNextLTPro-Demi.otf -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/concrete-tunnel.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/concrete-tunnel.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/concrete-tunnel.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/concrete-tunnel.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/large-dark-plate.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/large-dark-plate.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/large-dark-plate.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/large-dark-plate.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/custom/textVertAlignmentSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/custom/textVertAlignmentSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/system/textAllAlignmentsSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/p5.Font/system/textAllAlignmentsSketch.png -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/material/texture/assets/UV_Grid_Lg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/webgl/material/texture/assets/UV_Grid_Lg.jpg -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/material/texture/assets/UV_Grid_Sm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/webgl/material/texture/assets/UV_Grid_Sm.jpg -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/lucky_dragons_-_power_melody.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.dom/lucky_dragons_-_power_melody.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/lucky_dragons_-_power_melody.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.dom/lucky_dragons_-_power_melody.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/material/texture/assets/UV_Grid_Med.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/webgl/material/texture/assets/UV_Grid_Med.jpg -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadFont/global/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/async/loadFont/global/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadFont/instance/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/async/loadFont/instance/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /test/manual-test-examples/empty-example/sketch.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | // put setup code here 3 | createCanvas(600, 400); 4 | } 5 | 6 | function draw() { 7 | // put drawing code here 8 | } -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/1/red.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/Integrating-other-libraries/1/red.jpg -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/2/red.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/Integrating-other-libraries/2/red.jpg -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/material/texture/assets/tiny_grid_@2X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/webgl/material/texture/assets/tiny_grid_@2X.png -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_01.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_01.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_01.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_01.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_02.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_02.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_02.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/Damscray_-_Dancing_Tiger_02.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/material/texture/assets/360video_256crop_v2.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/webgl/material/texture/assets/360video_256crop_v2.mp4 -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme-src/scripts/tpl/search.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/lucky_dragons_-_power_melody.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/lucky_dragons_-_power_melody.mp3 -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/_files/lucky_dragons_-_power_melody.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/addons/p5.sound/_files/lucky_dragons_-_power_melody.ogg -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/0/rhodes_loop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/Integrating-other-libraries/0/rhodes_loop.wav -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/1/rhodes_loop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/Integrating-other-libraries/1/rhodes_loop.wav -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/2/rhodes_loop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmoren/p5.js/HEAD/test/manual-test-examples/tutorials/Integrating-other-libraries/2/rhodes_loop.wav -------------------------------------------------------------------------------- /lib/.gitkeep: -------------------------------------------------------------------------------- 1 | If you expected to see `p5.js`, `p5.min.js`, or other javascript files here, you probably need to run 2 | 3 | ```javascript 4 | grunt 5 | ``` 6 | 7 | on the command line from the root directory of this project. -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case3/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 3 2 | // Only draw(). 3 | // createCanvas() is called automatically with defaults. 4 | function draw() { 5 | ellipse(random(0, 400), random(0, 400), 50, 50); 6 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/capture_audio/sketch.js: -------------------------------------------------------------------------------- 1 | var capture; 2 | 3 | function setup() { 4 | createCanvas(390, 240); 5 | capture = createCapture(AUDIO); 6 | } 7 | 8 | function draw() { 9 | background(255); 10 | 11 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_STORE 2 | .project 3 | node_modules/* 4 | experiments/* 5 | lib_old/* 6 | lib/p5.* 7 | lib/addons/p5.dom.min.js 8 | docs/reference/* 9 | docs/yuidoc-p5-theme/assets/js/reference.js* 10 | !*.gitkeep 11 | examples/3d/ 12 | .idea 13 | .vscode -------------------------------------------------------------------------------- /src/math/polargeometry.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = { 3 | 4 | degreesToRadians: function(x) { 5 | return 2 * Math.PI * x / 360; 6 | }, 7 | 8 | radiansToDegrees: function(x) { 9 | return 360 * x / (2 * Math.PI); 10 | } 11 | 12 | }; 13 | -------------------------------------------------------------------------------- /test/manual-test-examples/tint/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/assets/mammals.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Goat 4 | Leopard 5 | Zebra 6 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/style/sketch.js: -------------------------------------------------------------------------------- 1 | var font; 2 | 3 | function preload() { 4 | font = loadFont("../acmesa.ttf"); 5 | } 6 | 7 | function setup() { 8 | var myDiv = createDiv('hello there'); 9 | myDiv.style('font-family', 'acmesa'); 10 | } 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadJSON_options/sketch.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | noCanvas(); 3 | loadJSON('http://api.openweathermap.org/data/2.5/station?id=5091',parseStuff,'json'); 4 | 5 | } 6 | 7 | function parseStuff(data){ 8 | console.log(data); 9 | } -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/filter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/saving.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/pixel/set-pixels.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case1/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 1 2 | // Only setup(). 3 | // setup() runs once and createCanvas() gets called automatically with defaults. 4 | function setup() { 5 | background(255, 0, 0); 6 | noStroke(); 7 | ellipse(0, 0, 50, 50); 8 | } -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/animate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/copying.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/cropping.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/drawing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Shape/test0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/pixel/update-pixels.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadJSON_options/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadJSON_preload/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadXML_preload/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/manipulate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/lights/ambientLight/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | background(0); 7 | 8 | ambientLight(150); 9 | 10 | ambientMaterial(250); 11 | sphere(50, 64); 12 | } -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadImage/global/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadImage/instance/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadStrings_callback/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadStrings_preload/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case5/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 5 2 | // setup() and draw() with createCanvas(). 3 | function setup() { 4 | createCanvas(400, 400); 5 | background(255, 255, 0); 6 | } 7 | function draw() { 8 | ellipse(random(0, 400), random(0, 400), 50, 50); 9 | } -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp7/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp9/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/invalid_json.js: -------------------------------------------------------------------------------- 1 | var myJson; 2 | 3 | function preload() { 4 | myJson = loadJSON('invalid.json'); 5 | } 6 | 7 | function setup(){ 8 | createCanvas(300, 300); 9 | } 10 | 11 | function draw() { 12 | text(myJson[0].a, 10, 10); 13 | } 14 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadFont/instance/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/audioelt_onended/sketch.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | audioEl = createAudio('../lucky_dragons_-_power_melody.mp3'); 3 | audioEl.showControls(true); 4 | audioEl.onended(sayDone); 5 | } 6 | 7 | function sayDone(elt) { 8 | alert('done playing ' + elt.src ); 9 | } -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/mobile/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | background(250); 7 | normalMaterial(); 8 | rotateX(accelerationX * 0.01); 9 | rotateY(accelerationY * 0.01); 10 | box(100, 100, 100); 11 | } -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadFont/global/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case4/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 4 2 | // setup() and draw() without createCanvas(). 3 | // createCanvas() is called automatically with defaults. 4 | function setup() { 5 | background(255, 0, 0); 6 | } 7 | function draw() { 8 | ellipse(random(0, 400), random(0, 400), 50, 50); 9 | } -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_to_canvas/sketch.js: -------------------------------------------------------------------------------- 1 | var fingers; 2 | 3 | function setup() { 4 | createCanvas(400, 400); 5 | fingers = createVideo("../fingers.mov"); 6 | fingers.loop(); 7 | fingers.hide(); 8 | } 9 | 10 | function draw() { 11 | background(150); 12 | image(fingers,10,10); 13 | } -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp7/example_7_1.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 7-1: Defining a function 8 | var drawBlackCircle = function() { 9 | fill(0); 10 | ellipse(50,50,20,20); 11 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/global-mousex/sketch.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | createCanvas(200, 200); 3 | ellipseMode(CENTER); 4 | } 5 | 6 | function draw() { 7 | background(125); 8 | console.log('mx:'+mouseX+' my:'+mouseY+' wmx:'+winMouseX+' wmy:'+winMouseY); 9 | ellipse(mouseX, mouseY, 20, 20); 10 | } -------------------------------------------------------------------------------- /test/unit/assets/array.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 0, 4 | "species": "Capra hircus", 5 | "name": "Goat" 6 | }, 7 | { 8 | "id": 1, 9 | "species": "Panthera pardus", 10 | "name": "Leopard" 11 | }, 12 | { 13 | "id": 2, 14 | "species": "Equus zebra", 15 | "name": "Zebra" 16 | } 17 | ] -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "curly": true, 4 | "eqeqeq": true, 5 | "eqnull": true, 6 | "immed": true, 7 | "latedef": "nofunc", 8 | "newcap": false, 9 | "noarg": true, 10 | "quotmark": "single", 11 | "trailing": true, 12 | "undef": true, 13 | "unused": "vars", 14 | 15 | "node": true 16 | } 17 | -------------------------------------------------------------------------------- /test/manual-test-examples/saveData/saveStrings/sketch.js: -------------------------------------------------------------------------------- 1 | // Example: saveStrings 2 | function setup() { 3 | var words = 'apple bear cat dog'; 4 | 5 | // split outputs an array 6 | var list = split(words, ' '); 7 | 8 | // Writes the strings to a file, each on a separate line 9 | save(list, 'nouns.txt'); 10 | } 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/keyboard/gamestyle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/global-mousex-offset/sketch.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | var c = createCanvas(200, 200); 3 | c.position(100, 100); 4 | } 5 | 6 | function draw() { 7 | background(125); 8 | ellipse(mouseX, mouseY, 20, 20); 9 | console.log('mx:'+mouseX+' my:'+mouseY+' wmx:'+winMouseX+' wmy:'+winMouseY); 10 | } -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/keyboard/keyIsPressed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp9/example_9_6.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 9-6: An array operation 8 | 9 | var values = []; 10 | 11 | for (var i = 0; i < 1000; i ++ ) { 12 | values[i] = values[i] * 2; 13 | } -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/instance-mousex-css/sketch.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var sketch = function(p) { 4 | p.setup = function() { 5 | p.createCanvas(300,300); 6 | p.background(200); 7 | } 8 | p.draw = function() { 9 | p.ellipse(p.mouseX, p.mouseY, 50, 50); 10 | } 11 | }; 12 | 13 | var myp5 = new p5(sketch, 'canvas1'); 14 | 15 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/saveTable/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | This example downloads a file. File download behavior depends on your browser. 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/saveData/saveStrings/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | This example downloads a file. File download behavior depends on your browser. 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/capture_video/sketch.js: -------------------------------------------------------------------------------- 1 | var capture; 2 | 3 | function setup() { 4 | createCanvas(320, 240); 5 | capture = createCapture(VIDEO); 6 | capture.size(320, 240); 7 | //capture.hide(); 8 | } 9 | 10 | function draw() { 11 | background(255); 12 | image(capture, 0, 0, 320, 240); 13 | filter('INVERT'); 14 | } 15 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp9/example_9_3.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 9-3: Initializing the elements of an array all at once 8 | 9 | var arrayOfInts = {1,5,8,9,4,5}; 10 | var floatArray = {1.2,3.5,2.0,3.4123,9.9}; -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/opentype/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/saveData/saveJSONArray/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | This example downloads a file. File download behavior depends on your browser. 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/saveData/saveJSONObject/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | This example downloads a file. File download behavior depends on your browser. 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_7/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp9/example_9_5.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 9-5: Using a for loop to initialize all elements of an array 8 | 9 | var values = []; 10 | 11 | for (var n = 0; n < 1000; n ++ ) { 12 | values[n] = random(0,10); 13 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/audioelt_onended/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadJSON_callback/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp9/example_9_7.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 9-7: An array operation using dot length 8 | 9 | var values = []; 10 | values.length = 100; 11 | 12 | for (var i = 0; i < values.length; i ++ ) { 13 | values[i] = 0; 14 | } 15 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/svgpath/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case2/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 2 2 | // Only setup() and createCanvas(). 3 | // setup() runs once and createCanvas() returns a pointer to the canvas created 4 | // with the input size, at 0,0. Holding the pointer is optional. 5 | function setup() { 6 | createCanvas(400, 400); 7 | background(255, 0, 0); 8 | noStroke(); 9 | ellipse(0, 0, 50, 50); 10 | } -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp9/example_9_4.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 9-4: Using a while loop to initialize all elements of an array 8 | 9 | var values = []; 10 | 11 | var n = 0; 12 | while (n < 1000) { 13 | values[n] = random(0,10); 14 | n = n + 1; 15 | } -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/renderpath/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/7/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/saving-images.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | // frameRate(1); 3 | createCanvas(600, 600); 4 | background(200); 5 | 6 | var i = loadImage("unicorn.jpg", function(img){ 7 | image(img, 10, 10); 8 | 9 | setTimeout(function(){ 10 | console.log("Save image") 11 | save(img, "unicorn.jpeg"); 12 | }, 1000); 13 | 14 | }); 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/webgl/shaders/vertexColor.vert: -------------------------------------------------------------------------------- 1 | attribute vec3 aPosition; 2 | attribute vec4 aVertexColor; 3 | 4 | uniform mat4 uModelViewMatrix; 5 | uniform mat4 uProjectionMatrix; 6 | 7 | varying vec4 vColor; 8 | 9 | void main(void) { 10 | vec4 positionVec4 = vec4(aPosition * vec3(1.0, -1.0, 1.0), 1.0); 11 | gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; 12 | vColor = aVertexColor; 13 | } 14 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp1/example_1_1.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // ported by Lauren McCarthy 6 | 7 | // Example 1-1: stroke and fill 8 | 9 | function setup(){ 10 | createCanvas(200,200); 11 | background(255); 12 | }; 13 | 14 | function draw(){ 15 | stroke(0); 16 | fill(150); 17 | rect(50,50,75,100); 18 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/invalid_json.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | P5.js - Invalid JSON test 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/trim/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig: http://EditorConfig.org 2 | 3 | # Top-most EditorConfig file 4 | root = true 5 | 6 | # Rules for JavaScript files: 7 | 8 | [*.js] 9 | # 2 space indentation 10 | indent_style = space 11 | indent_size = 2 12 | # No trailing spaces 13 | trim_trailing_whitespace = true 14 | # Unix-style newlines 15 | end_of_line = lf 16 | # Newline ending every file 17 | insert_final_newline = true 18 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/radio_test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/findRows/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/getColumn/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/getObject/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/matchRow/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/matchRows/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/dropdown_test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_options/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_preload/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/removeTokens/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/global/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_callback/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Open the console to view results 9 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/style/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/lights/pointLight/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | background(0); 7 | 8 | var locY = (mouseY / height - 0.5) * (-2); 9 | var locX = (mouseX / width - 0.5) *2; 10 | 11 | ambientLight(50); 12 | pointLight(250, 250, 250, locX, locY, 0); 13 | 14 | ambientMaterial(250); 15 | sphere(50, 64); 16 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/capture_audio/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/capture_video/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/input_button/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/slider_button/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/slider_tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/slider_tests/sketch.js: -------------------------------------------------------------------------------- 1 | var slider; 2 | 3 | function setup() { 4 | 5 | // create canvas 6 | canvas = createCanvas(200, 200); 7 | 8 | // create and position sliders 9 | slider = createSlider(0, 1, 0.5, 0.1); 10 | 11 | } 12 | 13 | function draw() { 14 | var b = slider.value(); 15 | background(b*255); 16 | }; 17 | 18 | function mousePressed() { 19 | slider.value(0); 20 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_button/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_circles/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_pixels/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_scrub/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_speed/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_to_canvas/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/brightness_mirror/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/capture_video_sizing/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_scrub/sketch.js: -------------------------------------------------------------------------------- 1 | var fingers; 2 | var slider; 3 | 4 | function setup() { 5 | noCanvas(); 6 | fingers = createVideo('../fingers.mov', videoReady); 7 | } 8 | 9 | function videoReady() { 10 | var len = fingers.duration(); 11 | slider = createSlider(0, len, 0, 0.1); 12 | slider.input(scrub); 13 | } 14 | 15 | function scrub() { 16 | fingers.time(slider.value()); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/lights/directionalLight/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | background(0); 7 | 8 | var dirY = (mouseY / height - 0.5) *2; 9 | var dirX = (mouseX / width - 0.5) *2; 10 | 11 | ambientLight(50); 12 | directionalLight(250, 250, 250, dirX, -dirY, 0.25); 13 | 14 | ambientMaterial(250); 15 | sphere(50, 64); 16 | } -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/instance-mousex/sketch.js: -------------------------------------------------------------------------------- 1 | var sketch = function(p) { 2 | 3 | var c; 4 | 5 | p.setup = function() { 6 | p.createCanvas(200, 200); 7 | }; 8 | 9 | p.draw = function() { 10 | p.background(125); 11 | p.ellipse(p.mouseX, p.mouseY, 20, 20); 12 | console.log('mx:'+p.mouseX+' my:'+p.mouseY+' wmx:'+p.winMouseX+' wmy:'+p.winMouseY); 13 | }; 14 | }; 15 | 16 | var myp5 = new p5(sketch); -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-global/case6/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 6 2 | // setup() and draw() with createCanvas(), holding pointer 3 | // parent call moves canvas to div with given id 4 | var canvas; 5 | function setup() { 6 | canvas = createCanvas(400, 400); 7 | canvas.parent('test'); 8 | background(255, 255, 0); 9 | } 10 | function draw() { 11 | ellipse(random(0, 400), random(0, 400), 50, 50); 12 | //console.log(mouseX); 13 | } -------------------------------------------------------------------------------- /test/manual-test-examples/saveData/saveJSONObject/sketch.js: -------------------------------------------------------------------------------- 1 | var json; 2 | 3 | function setup() { 4 | 5 | json = {}; // new JSON Object 6 | 7 | json.id = 0; 8 | json.species = 'Panthera leo'; 9 | json.name = 'Lion'; 10 | 11 | save(json, 'lion.json'); 12 | } 13 | 14 | // Sketch saves the following to a file called "lion.json": 15 | // { 16 | // "id": 0, 17 | // "species": "Panthera leo", 18 | // "name": "Lion" 19 | // } 20 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/DOM-extensions/0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

HI THIS IS THE HEADER

9 | 10 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/audioEltSpotify/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_preload/sketch.js: -------------------------------------------------------------------------------- 1 | var table; 2 | 3 | function preload() { 4 | table = loadTable('table.csv', 'header'); 5 | } 6 | 7 | function setup() { 8 | console.log(table); 9 | for (var i = 0; i < table.rows.length; i++) { 10 | for (var j = 0; j < table.columns.length; j++ ) { 11 | console.log(table.columns[j] +': '+ table.rows[i].getString(j) ); 12 | } 13 | console.log('---'); 14 | } 15 | } -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case0/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 0: no node specified 2 | // Canvas is auto-generated and appended to body. 3 | 4 | var sketch = function( p ) { 5 | 6 | var gray = 0; 7 | 8 | p.draw = function() { 9 | p.background(gray); 10 | p.rect(p.width/2, p.height/2, 50, 50); 11 | } 12 | 13 | p.mousePressed = function() { 14 | gray += 10; 15 | } 16 | 17 | }; 18 | 19 | var myp5 = new p5(sketch); -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/manual-test-examples/tutorials/Integrating-other-libraries/2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/micLevel/sketch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Make some noise to float the ellipse 3 | */ 4 | 5 | function setup() { 6 | createCanvas(400,400); 7 | mic = new p5.AudioIn(); 8 | mic.start(); 9 | } 10 | 11 | function draw() { 12 | background(0); 13 | 14 | // getLevel takes an optional smoothing value, or defaults to 0.0 15 | micLevel = mic.getLevel(); 16 | ellipse(width/2, height - micLevel*height, 100, 100); 17 | } -------------------------------------------------------------------------------- /test/manual-test-examples/loadingscreen/preload_success_callbacks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | P5.js - preload with success callbacks 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/webgl/interaction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var p5 = require('../core/core'); 4 | 5 | //@TODO: implement full orbit controls including 6 | //pan, zoom, quaternion rotation, etc. 7 | p5.prototype.orbitControl = function(){ 8 | if(this.mouseIsPressed){ 9 | this.rotateY((this.mouseX - this.width / 2) / (this.width / 2)); 10 | this.rotateX((this.mouseY - this.height / 2) / (this.width / 2)); 11 | } 12 | return this; 13 | }; 14 | 15 | module.exports = p5; -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/instance/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp1/example_1_2.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 1-2: noFill 8 | function setup(){ 9 | createCanvas(200,200); 10 | smooth(); 11 | background(255); 12 | // noFill() leaves the shape with only an outline. 13 | noFill(); 14 | stroke(0); 15 | }; 16 | 17 | function draw(){ 18 | ellipse(60,60,100,100); 19 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp9/example_9_2.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 9-2: Initializing the elements of an array one at a time 8 | 9 | var stuff = []; 10 | stuff[0] = 8; // The first element of the array equals 8 11 | stuff[1] = 3; // The second element of the array equals 3 12 | stuff[2] = 1; // The third element of the array equals 1 -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadTable_options/sketch.js: -------------------------------------------------------------------------------- 1 | var table; 2 | 3 | function setup() { 4 | loadTable('table.csv', 'tsv', logResults); 5 | } 6 | 7 | function logResults(results) { 8 | table = results; 9 | console.log(table); 10 | for (var i = 0; i < table.rows.length; i++) { 11 | for (var j = 0; j < table.columns.length; j++ ) { 12 | console.log(table.columns[j] +': '+ table.rows[i].getString(j) ); 13 | } 14 | console.log('---'); 15 | } 16 | } -------------------------------------------------------------------------------- /test/manual-test-examples/env/cursor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | P5.js - cursor(img) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/pathpoints/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/instance-mousex-offset/sketch.js: -------------------------------------------------------------------------------- 1 | var sketch = function(p) { 2 | 3 | var c; 4 | 5 | p.setup = function() { 6 | 7 | c = p.createCanvas(200, 200); 8 | c.position(100, 100); 9 | }; 10 | 11 | p.draw = function() { 12 | p.background(125); 13 | p.ellipse(p.mouseX, p.mouseY, 20, 20); 14 | console.log('mx:'+p.mouseX+' my:'+p.mouseY+' wmx:'+p.winMouseX+' wmy:'+p.winMouseY); 15 | }; 16 | }; 17 | 18 | var myp5 = new p5(sketch); -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_pixels/sketch.js: -------------------------------------------------------------------------------- 1 | var fingers; 2 | 3 | function setup() { 4 | createCanvas(400, 400); 5 | fingers = createVideo("../fingers.mov"); 6 | fingers.loop(); 7 | fingers.hide(); 8 | } 9 | 10 | function draw() { 11 | background(150); 12 | 13 | fingers.loadPixels(); 14 | for (var i=0; i 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/webgl/shaders/immediate.vert: -------------------------------------------------------------------------------- 1 | attribute vec3 aPosition; 2 | attribute vec4 aVertexColor; 3 | 4 | uniform mat4 uModelViewMatrix; 5 | uniform mat4 uProjectionMatrix; 6 | uniform float uResolution; 7 | uniform float uPointSize; 8 | 9 | varying vec4 vColor; 10 | void main(void) { 11 | vec4 positionVec4 = vec4(aPosition * vec3(1.0, -1.0, 1.0), 1.0); 12 | gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; 13 | vColor = aVertexColor; 14 | gl_PointSize = uPointSize; 15 | } 16 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case5/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 3: alternate syntax 2 | // Canvas is auto-generated and appended to body. 3 | 4 | var myp5 = new p5(function( p ) { 5 | 6 | var gray = 0; 7 | 8 | p.setup = function() { 9 | p.createCanvas(400, 400); 10 | }; 11 | 12 | p.draw = function() { 13 | p.background(gray); 14 | p.rect(p.width/2, p.height/2, 50, 50); 15 | } 16 | 17 | p.mousePressed = function() { 18 | gray += 10; 19 | } 20 | 21 | }); -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_1/catcher.js: -------------------------------------------------------------------------------- 1 | 2 | // Catch class 3 | 4 | function Catcher(tempR) { 5 | 6 | this.r = tempR; // radius 7 | this.x = 0; // location 8 | this.y = 0; 9 | } 10 | 11 | Catcher.prototype.setLocation = function(tempX, tempY) { 12 | this.x = tempX; 13 | this.y = tempY; 14 | }; 15 | 16 | Catcher.prototype.display = function() { 17 | stroke(0); 18 | fill(175); 19 | ellipse(this.x, this.y, this.r*2, this.r*2); 20 | }; 21 | 22 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/capture_video_sizing/sketch.js: -------------------------------------------------------------------------------- 1 | var capture; 2 | 3 | function setup() { 4 | createCanvas(390, 240); 5 | capture = createCapture(VIDEO); 6 | capture.size(320, 240); 7 | devicePixelScaling(false); 8 | } 9 | 10 | function draw() { 11 | background(255); 12 | image(capture, 0, 0); 13 | 14 | capture.loadPixels(); 15 | console.log(capture.pixels.length === 320*240*4); 16 | } 17 | 18 | function mousePressed() { 19 | capture.size(32, 24); 20 | } 21 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/checkbox_test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Another: 11 | 12 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_button/sketch.js: -------------------------------------------------------------------------------- 1 | var playing = false; 2 | var fingers, button; 3 | 4 | 5 | function setup() { 6 | fingers = createVideo('../fingers.mov'); 7 | 8 | button = createButton('play'); 9 | button.mousePressed(toggleVid); 10 | } 11 | 12 | function toggleVid() { 13 | if (playing) { 14 | fingers.pause(); 15 | button.html('play'); 16 | } else { 17 | fingers.loop(); 18 | button.html('pause'); 19 | } 20 | playing = !playing; 21 | } 22 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_8/example_10_8.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 10-8: Fancier looking raindrop 8 | 9 | function setup(){ 10 | background(255); 11 | smooth(); 12 | }; 13 | 14 | function draw(){ 15 | for (var i = 2; i < 8; i++ ) { 16 | noStroke(); 17 | fill(0); 18 | ellipse(width/2, height/2 + i*4, i*2, i*2); 19 | } 20 | }; -------------------------------------------------------------------------------- /src/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "curly": true, 4 | "trailing": true, 5 | "devel": true, 6 | "eqeqeq": true, 7 | "eqnull": true, 8 | "immed": true, 9 | "latedef": "nofunc", 10 | "newcap": false, 11 | "noarg": true, 12 | "quotmark": "single", 13 | "undef": true, 14 | "unused": "vars", 15 | "maxlen": 83, 16 | 17 | "browserify": true, 18 | "browser": true, 19 | "globals": { 20 | "require": false, 21 | "module": false, 22 | "PImage": false 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/manual-test-examples/tint/sketch.js: -------------------------------------------------------------------------------- 1 | var img; 2 | 3 | function preload() { 4 | img = loadImage("flowers.jpg"); 5 | } 6 | 7 | function setup() { 8 | createCanvas(800,160); 9 | fill(255, 255, 255); 10 | rect(0, 0, 480, 160); 11 | image(img, 0, 0); 12 | tint(0, 0, 150, 150); // Tint alpha blue 13 | image(img, 160, 0); 14 | tint(255, 255, 255); 15 | image(img, 320, 0); 16 | tint(0, 153, 150); // Tint turquoise 17 | image(img, 480, 0); 18 | noTint(); 19 | image(img, 640, 0); 20 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/PulseFFT/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/envelope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/micFFT/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/micLevel/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/record/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/waveform/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_1/example_10_1.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 10-1: Catcher 8 | 9 | var catcher; 10 | 11 | function setup(){ 12 | createCanvas(400,400); 13 | catcher = new Catcher(32); 14 | smooth(); 15 | }; 16 | 17 | function draw(){ 18 | background(255); 19 | catcher.setLocation(mouseX,mouseY); 20 | catcher.display(); 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp3/example_3_4.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 3-4: Drawing a continuous line 8 | function setup(){ 9 | createCanvas(200, 200); 10 | background(255); 11 | smooth(); 12 | }; 13 | 14 | function draw(){ 15 | stroke(0); 16 | // Draw a line from previous mouse location to current mouse location. 17 | line(pmouseX, pmouseY, mouseX, mouseY); 18 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/callback/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(240, 160); 3 | textSize(18); 4 | text("Default Text", 10, 30); 5 | noStroke(); 6 | fill(0, 102, 153); 7 | text("Black No Stroke Text", 10, 60); 8 | textSize(12); 9 | fill(120); 10 | loadFont("../SourceSansPro-Regular.otf", function(f){ 11 | textFont(f); 12 | text("Simple long Text: Lorem Ipsum is simply dummy text of the printing and typesetting industry. ", 10, 90, 220, 60); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/audio_button_slider/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/DelaySoundFile/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/FFT_freqRange/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/FFT_waveform/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/FFT_waveform_2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/Filter_LowPass/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/Reverb_basic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/envelopeOnOff/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/looper_simple/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/noiseMod_AM/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/outOfPhase/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/pan_soundfile/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/peakDetect/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/play_soundfile/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/playbackRate/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/recordLoops/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/soundFormats/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/DelayNoiseEnvelope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/Filter_BandPass/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/Reverb_convolve/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/Reverb_convolve_FFT/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/amplitude_analysis/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/autoCorrelation/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/loadSound_callback/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/loadSound_preload/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/micLevel_on_off/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/oscillatorMod_AM/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/oscillatorMod_FM/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/oscillatorWaveform/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/oscillator_FMSynth/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/pause_soundfile/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/peakDetect_basic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/soundfileMod_AM/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/soundfile_playMode/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/FFT_frequency_spectrum/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/oscillatorSecondsFromNow/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/waveform_with_playhead/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/simple/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/waveform_peaks_with_playhead/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/manual-test-examples/keyboard/gamestyle.js: -------------------------------------------------------------------------------- 1 | var x = 100; 2 | var y = 100; 3 | 4 | function setup() { 5 | createCanvas(512, 512); 6 | } 7 | 8 | function draw() { 9 | if (keyIsDown(LEFT_ARROW)) 10 | x-=5; 11 | 12 | if (keyIsDown(RIGHT_ARROW)) 13 | x+=5; 14 | 15 | if (keyIsDown(UP_ARROW)) 16 | y-=5; 17 | 18 | if (keyIsDown(DOWN_ARROW)) 19 | y+=5; 20 | 21 | clear(); 22 | text("I can be moved by pressing and holding the arrow keys, even diagonally!",0,10); 23 | 24 | fill(255, 0, 0); 25 | ellipse(x, y, 50, 50); 26 | } -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/camera/ortho/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | ortho(-width/2, width/2, height/2, -height/2, -500, 10000); 4 | } 5 | 6 | function draw(){ 7 | background(0); 8 | rotateX(map(mouseY, 0, height, 0, TWO_PI)); 9 | rotateY(map(mouseX, 0, width, 0, TWO_PI)); 10 | 11 | for(var i = -5; i < 6; i++){ 12 | for(var j = -5; j < 6; j++){ 13 | push(); 14 | translate(i*100, 0, j*100); 15 | box(20); 16 | pop(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case1/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 1: no node specified, createCanvas called 2 | // Canvas is generated and appended to body. 3 | 4 | var sketch = function( p ) { 5 | 6 | var gray = 0; 7 | 8 | p.setup = function() { 9 | p.createCanvas(400, 400); 10 | }; 11 | 12 | p.draw = function() { 13 | p.background(gray); 14 | p.rect(p.width/2, p.height/2, 50, 50); 15 | } 16 | 17 | p.mousePressed = function() { 18 | gray += 10; 19 | } 20 | 21 | }; 22 | 23 | var myp5 = new p5(sketch); -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_10/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_5/example_10_5.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 10-5: Object-oriented timer 8 | 9 | var timer; 10 | 11 | function setup(){ 12 | createCanvas(200,200); 13 | background(0); 14 | timer = new Timer(5000); 15 | timer.start(); 16 | }; 17 | 18 | function draw(){ 19 | if (timer.isFinished()) { 20 | background(random(255)); 21 | timer.start(); 22 | } 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_9/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme-src/scripts/tpl/search_suggestion.html: -------------------------------------------------------------------------------- 1 |

2 | 3 | <%=name%> 4 | 5 | 6 | <% if (final) { %> 7 | constant 8 | <% } else if (itemtype) { %> 9 | <%=itemtype%> 10 | <% } %> 11 | 12 | <% if (className) { %> 13 | in <%=className%> 14 | <% } %> 15 | 16 | <% if (is_constructor) { %> 17 | constructor 18 | <% } %> 19 | 20 | 21 |

-------------------------------------------------------------------------------- /src/webgl/shaders/normal.vert: -------------------------------------------------------------------------------- 1 | attribute vec3 aPosition; 2 | attribute vec3 aNormal; 3 | attribute vec2 aTexCoord; 4 | 5 | uniform mat4 uModelViewMatrix; 6 | uniform mat4 uProjectionMatrix; 7 | uniform mat3 uNormalMatrix; 8 | 9 | varying vec3 vVertexNormal; 10 | varying highp vec2 vVertTexCoord; 11 | 12 | void main(void) { 13 | vec4 positionVec4 = vec4(aPosition * vec3(1.0, -1.0, 1.0), 1.0); 14 | gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; 15 | vVertexNormal = vec3( uNormalMatrix * aNormal ); 16 | vVertTexCoord = aTexCoord; 17 | } 18 | -------------------------------------------------------------------------------- /test/manual-test-examples/keyboard/keyIsPressed.js: -------------------------------------------------------------------------------- 1 | function setup() { 2 | createCanvas(480, 480); 3 | } 4 | 5 | function draw() { 6 | background(255); 7 | 8 | if (keyIsPressed) { 9 | if (keyCode == UP_ARROW) { 10 | background(255, 0, 0); // red 11 | } 12 | if (keyCode == RIGHT_ARROW) { 13 | background(255, 255, 0); // yellow 14 | } 15 | if (keyCode == DOWN_ARROW) { 16 | background(0, 255, 0); // green 17 | } 18 | if (keyCode == LEFT_ARROW) { 19 | background(0, 0, 255); // blue 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/audioEltSpotifyCrossOrigin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp1/example_1_3.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 1-3: RGB Color 8 | function setup(){ 9 | smooth(); 10 | background(255); 11 | noStroke(); 12 | }; 13 | 14 | function draw(){ 15 | 16 | 17 | // Bright red 18 | fill(255,0,0); 19 | ellipse(20,20,16,16); 20 | 21 | // Dark red 22 | fill(127,0,0); 23 | ellipse(40,20,16,16); 24 | 25 | // Pink (pale red) 26 | fill(255,200,200); 27 | ellipse(60,20,16,16); 28 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case3/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 2: node specified, node is a DIV ELEMENT ID 2 | // A canvas with p5 attached will be inserted inside of it. 3 | 4 | var sketch = function( p ) { 5 | 6 | var gray = 0; 7 | 8 | p.setup = function() { 9 | p.createCanvas(400, 400); 10 | }; 11 | 12 | p.draw = function() { 13 | p.background(gray); 14 | p.rect(p.width/2, p.height/2, 50, 50); 15 | } 16 | 17 | p.mousePressed = function() { 18 | gray += 10; 19 | } 20 | 21 | }; 22 | 23 | var myp5 = new p5(sketch, 'p5-container'); -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme-src/scripts/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "eqeqeq": true, 4 | "eqnull": true, 5 | "immed": true, 6 | "latedef": "nofunc", 7 | "newcap": false, 8 | "noarg": true, 9 | "quotmark": "single", 10 | "undef": true, 11 | "unused": "vars", 12 | 13 | "node": true, 14 | 15 | "trailing": true, 16 | "curly": true, 17 | "indent": 2, 18 | 19 | "globals": { 20 | "window": true, 21 | "$": true, 22 | "jQuery": true, 23 | "console": true, 24 | "module": true, 25 | "define": false, 26 | "require": false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/file_input/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 | 16 |
17 | -------------------------------------------------------------------------------- /test/manual-test-examples/module.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Vector/NOC_2_5_fluidresistance/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/manual-test-examples/pixel/set-pixels.js: -------------------------------------------------------------------------------- 1 | 2 | var img; 3 | var radius=60; 4 | var smoothAmount; 5 | var canvasImg; 6 | 7 | function preload() { 8 | 9 | img = loadImage("unicorn.jpg"); // Load an image into the program 10 | } 11 | 12 | function setup() { 13 | createCanvas(256, 256); 14 | loadPixels(); 15 | set(width/2, height/2, img); 16 | } 17 | 18 | 19 | function draw() { 20 | 21 | for (var i=-5; i<5; i++) { 22 | set(mouseX+i, mouseY, [0, 0, 255, 100]); 23 | } 24 | set(mouseX, mouseY, [255, 0, 255, 255]); 25 | set(mouseX+10, mouseY+10, 0); 26 | updatePixels(); 27 | } 28 | -------------------------------------------------------------------------------- /test/manual-test-examples/empty-example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/camera/perspective/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | var fov = PI/3.0; 4 | var cameraZ = (height/2.0) / tan(fov/2.0); 5 | perspective(fov, width/height, cameraZ * 0.1, cameraZ * 10); 6 | } 7 | 8 | function draw(){ 9 | background(0); 10 | rotateX(map(mouseY, 0, height, 0, TWO_PI)); 11 | rotateY(map(mouseX, 0, width, 0, TWO_PI)); 12 | for(var i = -5; i < 6; i++){ 13 | for(var j = -5; j < 6; j++){ 14 | push(); 15 | translate(i*100, 0, j*100); 16 | sphere(20); 17 | pop(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /test/unit/webgl/p5.RendererGL.js: -------------------------------------------------------------------------------- 1 | suite('p5.RendererGL', function() { 2 | var myp5; 3 | 4 | if (!window.Modernizr.webgl) { 5 | return; 6 | } 7 | 8 | setup(function() { 9 | myp5 = new p5(function(p) { 10 | p.setup = function() { 11 | p.createCanvas(100, 100, p.WEBGL); 12 | }; 13 | }); 14 | }); 15 | 16 | teardown(function() { 17 | myp5.remove(); 18 | }); 19 | 20 | suite('createCanvas(w, h, WEBGL)', function() { 21 | test('creates a p5.RendererGL renderer', function() { 22 | assert.instanceOf(myp5._renderer, p5.RendererGL); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_9/catcher.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 10-1: Catcher 8 | 9 | function Catcher(tempR) { 10 | this.r = tempR; // radius 11 | this.x = 0; // location 12 | this.y = 0; 13 | } 14 | 15 | Catcher.prototype.setLocation = function(tempX, tempY) { 16 | this.x = tempX; 17 | this.y = tempY; 18 | }; 19 | 20 | Catcher.prototype.display = function() { 21 | stroke(0); 22 | fill(175); 23 | ellipse(this.x, this.y, this.r*2, this.r*2); 24 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/interaction/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | background(250); 7 | var radius = width; 8 | 9 | orbitControl(); 10 | 11 | normalMaterial(); 12 | translate(0, 0, -1000); 13 | for(var i = 0; i <= 20; i++){ 14 | for(var j = 0; j <= 20; j++){ 15 | push(); 16 | var a = j/20 * PI; 17 | var b = i/20 * PI 18 | translate(sin(2 * a) * radius * sin(b), cos(b) * radius / 2 , cos(2 * a) * radius * sin(b)); 19 | cone(); 20 | pop(); 21 | } 22 | } 23 | 24 | 25 | } -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/material/simple/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | background(0); 7 | 8 | translate(-width/4, 0, 0); 9 | 10 | ambientLight(50); 11 | pointLight(250, 250, 250, -70, 70, 0); 12 | 13 | basicMaterial(250); 14 | sphere(); 15 | 16 | translate(250, 0, 0); 17 | 18 | normalMaterial(250); 19 | sphere(); 20 | 21 | translate(250, 0, 0); 22 | 23 | ambientMaterial(250); 24 | sphere(50, 128); 25 | 26 | translate(250, 0, 0); 27 | 28 | specularMaterial(250); 29 | sphere(50, 128); 30 | } -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadStrings_callback/tenderbuttons_excerpt.txt: -------------------------------------------------------------------------------- 1 | SALAD. 2 | It is a winning cake. 3 | SAUCE. 4 | What is bay labored what is all be section, what is no much. Sauce sam 5 | in. 6 | SALMON. 7 | It was a peculiar bin a bin fond in beside. 8 | ORANGE. 9 | Why is a feel oyster an egg stir. Why is it orange centre. 10 | A show at tick and loosen loosen it so to speak sat. 11 | It was an extra leaker with a see spoon, it was an extra licker with a 12 | see spoon. 13 | ORANGE. 14 | A type oh oh new new not no not knealer knealer of old show beefsteak, 15 | neither neither. 16 | ORANGES. 17 | Build is all right. -------------------------------------------------------------------------------- /test/manual-test-examples/async/loadStrings_preload/tenderbuttons_excerpt.txt: -------------------------------------------------------------------------------- 1 | SALAD. 2 | It is a winning cake. 3 | SAUCE. 4 | What is bay labored what is all be section, what is no much. Sauce sam 5 | in. 6 | SALMON. 7 | It was a peculiar bin a bin fond in beside. 8 | ORANGE. 9 | Why is a feel oyster an egg stir. Why is it orange centre. 10 | A show at tick and loosen loosen it so to speak sat. 11 | It was an extra leaker with a see spoon, it was an extra licker with a 12 | see spoon. 13 | ORANGE. 14 | A type oh oh new new not no not knealer knealer of old show beefsteak, 15 | neither neither. 16 | ORANGES. 17 | Build is all right. -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_6/example_10_6.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 10-6: Simple raindrop behavior 8 | 9 | // Variables for drop location 10 | var x,y; 11 | 12 | function setup(){ 13 | createCanvas(400,400); 14 | background(0); 15 | x = width/2; 16 | y = 0; 17 | smooth(); 18 | }; 19 | 20 | function draw(){ 21 | background(255); 22 | // Display the drop 23 | fill(50,100,150); 24 | noStroke(); 25 | ellipse(x,y,16,16); 26 | // Move the drop 27 | y++ ; 28 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp4/example_4_2.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 4-2: Using variables 8 | 9 | // Declare and initialize two variables at the top of the code. 10 | var circleX = 100; 11 | var circleY = 100; 12 | 13 | function setup(){ 14 | createCanvas(200,200); 15 | smooth(); 16 | }; 17 | 18 | function draw(){ 19 | background(255); 20 | stroke(0); 21 | fill(175); 22 | // Use the variables to specify the location of an ellipse. 23 | ellipse(circleX,circleY,50,50); 24 | }; 25 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Shape/test0/circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Vector/NOC_6_09_Flocking/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Nature of Code Example 6.1 Seek 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/helpers/helpers_prod.js: -------------------------------------------------------------------------------- 1 | var configHelpers = {}; 2 | 3 | // For production, the reference docs are put in the /reference/ folder 4 | // of the p5 website, so we'll define our paths with this assumption. 5 | // For more context, see https://github.com/processing/p5.js-website. 6 | var config = { 7 | p5SiteRoot: '..', 8 | p5Lib: '../js/p5.min.js', 9 | p5SoundLib: '../js/p5.sound.min.js', 10 | p5DomLib: '../js/p5.dom.min.js' 11 | }; 12 | 13 | Object.keys(config).forEach(function(key) { 14 | configHelpers[key] = function() { 15 | return config[key]; 16 | }; 17 | }); 18 | 19 | 20 | module.exports = configHelpers; 21 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Vector/NOC_6_09_Flocking/flock.js: -------------------------------------------------------------------------------- 1 | // The Nature of Code 2 | // Daniel Shiffman 3 | // http://natureofcode.com 4 | 5 | // Flock object 6 | // Does very little, simply manages the array of all the boids 7 | 8 | function Flock() { 9 | // An array for all the boids 10 | this.boids = []; // Initialize the array 11 | } 12 | 13 | Flock.prototype.run = function() { 14 | for (var i = 0; i < this.boids.length; i++) { 15 | this.boids[i].run(this.boids); // Passing the entire list of boids to each boid individually 16 | } 17 | } 18 | 19 | Flock.prototype.addBoid = function(b) { 20 | this.boids.push(b); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/performance/sketch.js: -------------------------------------------------------------------------------- 1 | var theta = 0; 2 | 3 | function setup(){ 4 | createCanvas(windowWidth, windowHeight, WEBGL); 5 | } 6 | 7 | function draw(){ 8 | background(250, 250, 250, 255); 9 | 10 | normalMaterial(); 11 | translate(0, 0, -800); 12 | rotateY(frameCount * 0.01); 13 | 14 | for(var j = 0; j < 5; j++){ 15 | push(); 16 | for(var i = 0; i < 200; i++){ 17 | translate(sin(theta + j) * 100, sin(theta + j) * 100, i * 0.1); 18 | rotateZ(theta * 0.2); 19 | push(); 20 | sphere(8, 6, 4); 21 | pop(); 22 | } 23 | pop(); 24 | } 25 | 26 | theta += 0.02; 27 | 28 | } -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp6/example_6_6.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 6-6: Legs with a for loop 8 | 9 | var y = 80; // Vertical location of each line 10 | var spacing = 10; // How far apart is each line 11 | var len = 20; // Length of each line 12 | 13 | function setup(){ 14 | createCanvas(200,200); 15 | background(255); 16 | }; 17 | 18 | function draw(){ 19 | // Translation of the legs while loop to a for loop. 20 | for (var x = 50; x <= 150; x += spacing) { 21 | line(x,y,x,y + len); 22 | } 23 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/micFFT/sketch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Visualize the frequency spectrum of live audio input 3 | */ 4 | 5 | var mic, fft; 6 | 7 | function setup() { 8 | createCanvas(512,400); 9 | noStroke(); 10 | fill(0,255,255); 11 | 12 | mic = new p5.AudioIn(); 13 | mic.start(); 14 | fft = new p5.FFT(); 15 | fft.setInput(mic); 16 | } 17 | 18 | function draw() { 19 | background(200); 20 | var spectrum = fft.analyze(); 21 | 22 | beginShape(); 23 | vertex(0, height); 24 | for (i = 0; i 2 | 3 | 4 | 5 | 6 | 7 |
8 | (0, 0)
9 | mouseX: 0
10 | mouseY: 0
11 | winMouseX: 0
12 | winMouseY: 0
13 |
14 | (100, 100)
15 | mouseX: 100
16 | mouseY: 100
17 | winMouseX: 100
18 | winMouseY: 100
19 |
20 | (400, 400)
21 | mouseX: 400
22 | mouseY: 400
23 | winMouseX: 400
24 | winMouseY: 400
25 |
26 |
27 | -------------------------------------------------------------------------------- /test/manual-test-examples/instantiation-instance/case4/sketch.js: -------------------------------------------------------------------------------- 1 | // CASE 2: node specified, node is a DIV ELEMENT 2 | // A canvas with p5 attached will be inserted inside of it. 3 | 4 | var sketch = function( p ) { 5 | 6 | var gray = 0; 7 | 8 | p.setup = function() { 9 | p.createCanvas(400, 400); 10 | }; 11 | 12 | p.draw = function() { 13 | p.background(gray); 14 | p.rect(p.width/2, p.height/2, 50, 50); 15 | } 16 | 17 | p.mousePressed = function() { 18 | gray += 10; 19 | } 20 | 21 | }; 22 | 23 | window.onload = function() { 24 | var containerNode = document.getElementById( 'p5-container' ); 25 | var myp5 = new p5(sketch, containerNode); 26 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_2/example_10_2.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 10-2: Bouncing ball class 8 | 9 | // Two ball variables 10 | var ball1; 11 | var ball2; 12 | 13 | function setup(){ 14 | createCanvas(400,400); 15 | smooth(); 16 | 17 | // Initialize balls 18 | ball1 = new Ball(64); 19 | ball2 = new Ball(32); 20 | }; 21 | 22 | function draw(){ 23 | background(255); 24 | 25 | // Move and display balls 26 | ball1.move(); 27 | ball2.move(); 28 | ball1.display(); 29 | ball2.display(); 30 | }; 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp6/example_6_1.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 6-1: Many lines 8 | 9 | function setup(){ 10 | createCanvas(200,200); 11 | background(255); 12 | }; 13 | 14 | function draw(){ 15 | // Legs 16 | stroke(0); 17 | line(50,60,50,80); 18 | line(60,60,60,80); 19 | line(70,60,70,80); 20 | line(80,60,80,80); 21 | line(90,60,90,80); 22 | line(100,60,100,80); 23 | line(110,60,110,80); 24 | line(120,60,120,80); 25 | line(130,60,130,80); 26 | line(140,60,140,80); 27 | line(150,60,150,80); 28 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/instance-mousex/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | (0, 0)
9 | mouseX: 0
10 | mouseY: 0
11 | winMouseX: 0
12 | winMouseY: 0
13 |
14 | (100, 100)
15 | mouseX: 100
16 | mouseY: 100
17 | winMouseX: 100
18 | winMouseY: 100
19 |
20 | (400, 400)
21 | mouseX: 400
22 | mouseY: 400
23 | winMouseX: 400
24 | winMouseY: 400
25 |
26 |
27 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/getColumn/sketch.js: -------------------------------------------------------------------------------- 1 | var table; 2 | 3 | function setup() { 4 | 5 | table = new p5.Table(); 6 | 7 | table.addColumn("name"); 8 | table.addColumn("type"); 9 | 10 | var newRow = table.addRow(); 11 | newRow.setString("name", "Lion"); 12 | newRow.setString("type", "Mammal"); 13 | 14 | newRow = table.addRow(); 15 | newRow.setString("name", "Snake"); 16 | newRow.setString("type", "Reptile"); 17 | 18 | newRow = table.addRow(); 19 | newRow.setString("name", "Mosquito"); 20 | newRow.setString("type", "Insect"); 21 | 22 | print(table.getColumn("name")); 23 | } 24 | 25 | // Sketch prints: 26 | // ["Lion", "Snake", "Mosquito"] 27 | -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/global-mousex-offset/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | (0, 0)
9 | mouseX: -100
10 | mouseY: -100
11 | winMouseX: 0
12 | winMouseY: 0
13 |
14 | (100, 100)
15 | mouseX: 0
16 | mouseY: 0
17 | winMouseX: 100
18 | winMouseY: 100
19 |
20 | (400, 400)
21 | mouseX: 300
22 | mouseY: 300
23 | winMouseX: 400
24 | winMouseY: 400
25 |
26 |
27 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/matchRow/sketch.js: -------------------------------------------------------------------------------- 1 | var table; 2 | 3 | function setup() { 4 | 5 | table = new p5.Table(); 6 | 7 | table.addColumn("name"); 8 | table.addColumn("type"); 9 | 10 | var newRow = table.addRow(); 11 | newRow.setString("name", "Lion"); 12 | newRow.setString("type", "Mammal"); 13 | 14 | newRow = table.addRow(); 15 | newRow.setString("name", "Snake"); 16 | newRow.setString("type", "Reptile"); 17 | 18 | newRow = table.addRow(); 19 | newRow.setString("name", "Mosquito"); 20 | newRow.setString("type", "Insect"); 21 | 22 | var result = table.matchRow("R.*", "type"); 23 | print(result.getString("name")); // Prints "Snake" 24 | 25 | } 26 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/mixedMode/sketch.js: -------------------------------------------------------------------------------- 1 | var theta = 0; 2 | 3 | function setup(){ 4 | createCanvas(windowWidth, windowHeight, WEBGL); 5 | } 6 | 7 | function draw(){ 8 | 9 | background('white'); 10 | colorMode(HSB); 11 | 12 | orbitControl(); 13 | 14 | for(var i = 0; i < 500; i+=100){ 15 | 16 | push(); 17 | translate(0, 0, i); 18 | basicMaterial(i * 0.1, 100, 100); 19 | 20 | push(); 21 | translate(0, cos( i + frameCount * 0.1) * 10, 0); 22 | box(20, 20, 20); 23 | pop(); 24 | fill(i * 0.1, 100, 100); 25 | line( 26 | -100, sin( i + frameCount * 0.1) * 10, 0, 27 | 100, sin( i + frameCount * 0.1) * 10, 0 28 | ); 29 | pop(); 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /test/manual-test-examples/mouse-events/instance-mousex-offset/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | (0, 0)
9 | mouseX: -100
10 | mouseY: -100
11 | winMouseX: 0
12 | winMouseY: 0
13 |
14 | (100, 100)
15 | mouseX: 0
16 | mouseY: 0
17 | winMouseX: 100
18 | winMouseY: 100
19 |
20 | (400, 400)
21 | mouseX: 300
22 | mouseY: 300
23 | winMouseX: 400
24 | winMouseY: 400
25 |
26 |
27 | -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme-src/scripts/tpl/list.html: -------------------------------------------------------------------------------- 1 | <% _.each(groups, function(group){ %> 2 |

<%=group.name%>

3 |
4 | <% _.each(group.subgroups, function(subgroup, ind) { %> 5 |
6 | <% if (subgroup.name !== '0') { %> 7 |
<%=subgroup.name%>
8 | <% } %> 9 | <% _.each(subgroup.items, function(item) { %> 10 |
<%=item.name%><% if (item.itemtype === 'method') { %>()<%}%>
11 | <% }); %> 12 |
13 | <% }); %> 14 |
15 | <% }); %> 16 | -------------------------------------------------------------------------------- /docs/yuidoc-p5-theme/helpers/helpers_dev.js: -------------------------------------------------------------------------------- 1 | var configHelpers = {}; 2 | 3 | // For development, we want the links to parts of the p5 website to work, 4 | // so we make them absolute. However, we want links to the p5 libraries 5 | // to point to the generated files on our development server, so we'll 6 | // reference them accordingly. 7 | var config = { 8 | p5SiteRoot: 'http://staging.p5js.org', 9 | p5Lib: '/lib/p5.min.js', 10 | p5SoundLib: '/lib/addons/p5.sound.min.js', 11 | p5DomLib: '/lib/addons/p5.dom.min.js' 12 | }; 13 | 14 | Object.keys(config).forEach(function(key) { 15 | configHelpers[key] = function() { 16 | return config[key]; 17 | }; 18 | }); 19 | 20 | module.exports = configHelpers; 21 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/file_input/sketch.js: -------------------------------------------------------------------------------- 1 | // ITP Networked Media, Fall 2014 2 | // https://github.com/shiffman/itp-networked-media 3 | // Daniel Shiffman 4 | 5 | // based on http://www.html5rocks.com/en/tutorials/file/dndfiles/ 6 | 7 | var fileSelect; 8 | 9 | function setup() { 10 | noCanvas(); 11 | fileSelect = createFileInput(gotFile, 'multiple'); 12 | } 13 | 14 | function gotFile(file) { 15 | var fileDiv = createDiv(file.name + ' ' + file.type + ' ' + file.subtype + ' ' + file.size + ' bytes'); 16 | if (file.type === 'image') { 17 | var img = createImg(file.data); 18 | img.class('thumb'); 19 | } else if (file.type === 'text') { 20 | createDiv(file.data); 21 | } 22 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/video_circles/sketch.js: -------------------------------------------------------------------------------- 1 | var fingers; 2 | 3 | function setup() { 4 | createCanvas(320, 240); 5 | fingers = createVideo(["../fingers.mov", "../fingers.webm"]); 6 | fingers.loop(); 7 | fingers.hide(); 8 | noStroke(); 9 | fill(0); 10 | } 11 | 12 | function draw() { 13 | background(255); 14 | fingers.loadPixels(); 15 | var stepSize = round(constrain(mouseX / 8, 6, 32)); 16 | for (var y=0; y 300) { 22 | sX = 0; 23 | sY += 150; 24 | if (sY === 600) { 25 | sY = 0; 26 | } 27 | } 28 | 29 | // Show full sprite sheet for reference 30 | image(runningCat, 0, 300, 300, 300); 31 | } 32 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Image/copying-images.js: -------------------------------------------------------------------------------- 1 | var image1; 2 | var image2; 3 | 4 | function setup() { 5 | frameRate(1); 6 | createCanvas(600, 600); 7 | background(200); 8 | 9 | //Copy image 1 into image 2 10 | image1 = createImage(40,40); 11 | image2 = loadImage("unicorn.jpg", function(img){ 12 | image1.copy(img, 0, 0, 36, 36, 0, 0, 40, 40); 13 | 14 | image(image1, 10, 10); 15 | image(img, 10, 75); 16 | }); 17 | 18 | 19 | //Copy an image into iself 20 | image3 = loadImage("cat.jpg", function(img){ 21 | 22 | img.copy(img.width/2, 0, img.width/2, img.height, 0, 0, img.width/2, img.height); 23 | 24 | image(img, 10, 350); 25 | }); 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp4/example_4_5.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 4-5: Using system variables 8 | function setup(){ 9 | createCanvas(200,200); 10 | smooth(); 11 | } 12 | 13 | function draw(){ 14 | background(100); 15 | stroke(255); 16 | // frameCount is used to color a rectangle. 17 | fill(frameCount / 2); 18 | rectMode(CENTER); 19 | // The rectangle will always be in the middle of the window 20 | // if it is located at (width/2, height/2). 21 | rect(width/2,height/2,mouseX+10,mouseY+10); 22 | } 23 | 24 | function keyPressed() { 25 | print(key); 26 | } 27 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/dropdown_test/sketch.js: -------------------------------------------------------------------------------- 1 | var dropdown; 2 | 3 | function setup() { 4 | dropdown = createSelect(); // or create dropdown? 5 | 6 | // just mucking around 7 | dropdown.option('apple','1'); 8 | dropdown.option('orange','2'); 9 | dropdown.option('pear'); 10 | 11 | // Set what it starts as 12 | dropdown.value('2'); 13 | 14 | dropdown.changed(mySelectEvent); 15 | } 16 | 17 | function draw() { 18 | background(0); 19 | if (dropdown.selected() === '1') { 20 | background(255, 0, 0); 21 | } 22 | } 23 | 24 | function mySelectEvent() { 25 | var selected = this.selected(); 26 | if (selected === 'pear') { 27 | console.log("it's a pear!"); 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp6/example_6_4.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 6-4: Infinite loop. Don't do this! 8 | 9 | var x = 0; 10 | 11 | function setup(){ 12 | 13 | while (x < 10) { 14 | print(x); 15 | // Decrementing x results in an infinite loop here because the value of x will never be 10 or greater. 16 | // Be careful! 17 | x = x - 1; 18 | 19 | // This line quits the loop so that this sketch does not crash 20 | // Comment it out to see Processing crash! (save everything else first!) 21 | break; 22 | } 23 | }; 24 | 25 | function draw(){ 26 | 27 | }; 28 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp1/example_1_5.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 1-5: Zoog 8 | 9 | function setup(){ 10 | createCanvas(200,200); 11 | background(255); 12 | smooth(); 13 | ellipseMode(CENTER); 14 | rectMode(CENTER); 15 | }; 16 | 17 | function draw(){ 18 | // Body 19 | stroke(0); 20 | fill(150); 21 | rect(100,100,20,100); 22 | 23 | // Head 24 | fill(255); 25 | ellipse(100,70,60,60); 26 | 27 | // Eyes 28 | fill(0); 29 | ellipse(81,70,16,32); 30 | ellipse(119,70,16,32); 31 | 32 | // Legs 33 | stroke(0); 34 | line(90,150,80,160); 35 | line(110,150,120,160); 36 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/callback/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp3/example_3_2.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 3-2: mouseX and mouseY 8 | 9 | function setup(){ 10 | createCanvas(200,200); 11 | }; 12 | 13 | function draw(){ 14 | // Try moving background() to setup() and see the difference! 15 | background(255); 16 | 17 | // Body 18 | stroke(0); 19 | fill(175); 20 | rectMode(CENTER); 21 | 22 | // mouseX is a keyword that the sketch replaces with the horizontal position of the mouse. 23 | // mouseY is a keyword that the sketch replaces with the vertical position of the mouse. 24 | rect(mouseX,mouseY,50,50); 25 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/lights/multipleLights/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | background(0); 7 | 8 | var locY = (mouseY / height - 0.5) * (-2); 9 | var locX = (mouseX / width - 0.5) *2; 10 | 11 | ambientLight(50); 12 | directionalLight(200, 0, 0, 0.25, 0.25, 0.25); 13 | pointLight(0, 0, 200, locX, locY, 0); 14 | pointLight(200, 200, 0, -locX, -locY, 0); 15 | 16 | push(); 17 | translate(-150, 0, 0); 18 | rotateZ(frameCount * 0.02); 19 | rotateX(frameCount * 0.02); 20 | specularMaterial(250); 21 | box(50); 22 | pop(); 23 | 24 | push(); 25 | translate(150, 0, 0); 26 | ambientMaterial(250); 27 | sphere(60, 64); 28 | } -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp4/example_4_3.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 4-3: Varying variables 8 | 9 | // Declare and initialize two variables at the top of the code. 10 | var circleX = 0; 11 | var circleY = 100; 12 | 13 | function setup(){ 14 | createCanvas(200,200); 15 | smooth(); 16 | }; 17 | 18 | function draw(){ 19 | background(255); 20 | stroke(0); 21 | fill(175); 22 | // Use the variables to specify the location of an ellipse. 23 | ellipse(circleX,circleY,50,50); 24 | 25 | // An assignment operation that increments the value of circleX by 1. 26 | circleX = circleX + 1; 27 | }; 28 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/oscillatorSecondsFromNow/sketch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Example: change amplitude with fadeTime, and schedule the change to happen in the future. 3 | */ 4 | 5 | function setup() { 6 | osc = new p5.TriOsc(); 7 | osc.freq(260); 8 | createP('mousePressed: set amplitude to .7 over the course of .2 seconds'); 9 | createP('mouseReleased: 1 second fade to 0. Start the fade 0.5 seconds from now'); 10 | } 11 | 12 | function mousePressed () { 13 | osc.start(); 14 | // fade amplitude to .7 over the course of .2 seconds 15 | osc.amp(0.7, 0.002); 16 | } 17 | 18 | function mouseReleased() { 19 | // fade amplitude to zero over the course of 1 second. Start the fade after .5 seconds. 20 | osc.amp(0, 0.2, 0.5); 21 | } 22 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp4/example_4_6.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 4-6: Ellipse with variables 8 | 9 | // Declare and initialize your variables! 10 | var r = 100; 11 | var g = 150; 12 | var b = 200; 13 | var a = 200; 14 | 15 | var diam = 20; 16 | var x = 100; 17 | var y = 100; 18 | 19 | function setup(){ 20 | createCanvas(200,200); 21 | background(255); 22 | smooth(); 23 | }; 24 | 25 | function draw(){ 26 | // Use those variables to draw an ellipse 27 | stroke(0); 28 | fill(r,g,b,a); // (Remember, the fourth argument for a color is transparency. 29 | ellipse(x,y,diam,diam); 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /test/manual-test-examples/webgl/origin/center_origin/sketch.js: -------------------------------------------------------------------------------- 1 | function setup(){ 2 | createCanvas(windowWidth, windowHeight, WEBGL); 3 | } 4 | 5 | function draw(){ 6 | 7 | background(255); 8 | 9 | rotateY(frameCount * 0.01); 10 | 11 | var gap = 200; 12 | var w = 100; 13 | var h = 100; 14 | 15 | for(var i = -2; i < 3; i++){ 16 | for(var j = -2; j < 3; j++){ 17 | basicMaterial( (i+2) * 40, (j+2) * 40, 0); 18 | push(); 19 | translate(i*gap, j*gap,0); 20 | plane(); 21 | pop(); 22 | // quad( 23 | // i * gap, j * gap, 0, 24 | // i * gap + w, j * gap, 0, 25 | // i * gap, j * gap + h, 0, 26 | // i * gap + w, j * gap + h, 0 27 | // ); 28 | } 29 | } 30 | 31 | 32 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/file_input_div/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | 22 | 23 | 24 |
25 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/getObject/sketch.js: -------------------------------------------------------------------------------- 1 | var table; 2 | 3 | function setup() { 4 | 5 | table = new p5.Table(); 6 | 7 | table.addColumn("name"); 8 | table.addColumn("type"); 9 | 10 | var newRow = table.addRow(); 11 | newRow.setString("name", "Lion"); 12 | newRow.setString("type", "Mammal"); 13 | 14 | newRow = table.addRow(); 15 | newRow.setString("name", "Snake"); 16 | newRow.setString("type", "Reptile"); 17 | 18 | newRow = table.addRow(); 19 | newRow.setString("name", "Mosquito"); 20 | newRow.setString("type", "Insect"); 21 | 22 | print("Without a header column:", table.getObject()); 23 | print("With a header column:", table.getObject("name")); 24 | } 25 | 26 | // Sketch prints: 27 | // ["Lion", "Snake", "Mosquito"] 28 | -------------------------------------------------------------------------------- /test/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "curly": true, 4 | "eqeqeq": true, 5 | "eqnull": true, 6 | "immed": true, 7 | "latedef": "nofunc", 8 | "newcap": true, 9 | "noarg": true, 10 | "quotmark": "single", 11 | "undef": true, 12 | "unused": "vars", 13 | 14 | "browser": true, 15 | "globals": { 16 | "assert": false, 17 | "suite": false, 18 | "setup": false, 19 | "teardown": false, 20 | "test": false, 21 | "afterEach": false, 22 | "beforeEach": false, 23 | "define": false, 24 | "describe": false, 25 | "expect": false, 26 | "it": false, 27 | "sinon": false, 28 | "console": false, 29 | "PElement": false, 30 | "p5": false, 31 | "PVector": false, 32 | "testRender": false 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Font/pathpoints/sketch.js: -------------------------------------------------------------------------------- 1 | // Adapted from Dan Shiffman's 'The Nature 2 | // of Code': http://natureofcode.com 3 | 4 | var flock; 5 | 6 | function setup() { 7 | 8 | createCanvas(500,300); 9 | 10 | flock = new Flock(); 11 | 12 | loadFont("../opentype/AvenirNextLTPro-Demi.otf", function(f) { 13 | 14 | var points = f.textToPoints('p5.js', 80, 185, 150); 15 | for (var k = 0; k < points.length; k++) { 16 | 17 | flock.boids.push(new Boid(points[k])); 18 | } 19 | }); 20 | } 21 | 22 | function draw() { 23 | 24 | var c = flock.count / flock.boids.length; 25 | background(c * 237, 34, 93); 26 | flock.run(); 27 | } 28 | 29 | function mouseReleased() { 30 | 31 | if (flock.arrived()) flock.arrived(false); 32 | } 33 | -------------------------------------------------------------------------------- /test/manual-test-examples/p5.Table/saveTable/sketch.js: -------------------------------------------------------------------------------- 1 | var table; 2 | 3 | function setup() { 4 | 5 | table = new p5.Table(); 6 | 7 | table.addColumn('name'); 8 | table.addColumn('type'); 9 | 10 | var newRow = table.addRow(); 11 | newRow.setString('name', 'Lion'); 12 | newRow.setString('type', 'Mammal'); 13 | 14 | newRow = table.addRow(); 15 | newRow.setString('name', 'Snake'); 16 | newRow.setString('type', 'Reptile'); 17 | 18 | newRow = table.addRow(); 19 | newRow.setString('name', 'Mosquito'); 20 | newRow.setString('type', 'Insect'); 21 | 22 | save(table, 'animals.csv'); 23 | } 24 | 25 | // Sketch saves the following to a file called 'animals.csv': 26 | // 27 | // name,type 28 | // Lion,Mammal 29 | // Snake,Reptile 30 | // Mosquito,Insect 31 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.dom/radio_test/sketch.js: -------------------------------------------------------------------------------- 1 | var radio; 2 | 3 | function setup() { 4 | radio = createRadio(); 5 | radio.id('test'); 6 | //radio = createSelect(); // for comparison 7 | 8 | // just mucking around 9 | radio.option('apple','1'); 10 | radio.option('orange','2'); 11 | radio.option('pear'); 12 | 13 | // Set what it starts as 14 | radio.selected('2'); 15 | 16 | radio.changed(mySelectEvent); 17 | } 18 | 19 | function draw() { 20 | background(0); 21 | if (radio.selected() === '1') { 22 | background(255, 0, 0); 23 | } 24 | } 25 | 26 | function mySelectEvent() { 27 | var selected = this.selected(); 28 | console.log(this.value()); 29 | if (selected === 'pear') { 30 | console.log("it's a pear!"); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/pause_soundfile/sketch.js: -------------------------------------------------------------------------------- 1 | // ==================== 2 | // DEMO: pause sound when the user presses a key, resume on release 3 | // ==================== 4 | 5 | var soundFile; 6 | 7 | function preload() { 8 | // create a SoundFile 9 | soundFormats('ogg', 'mp3'); 10 | soundFile = loadSound('../_files/Damscray_-_Dancing_Tiger_02'); 11 | } 12 | 13 | function setup() { 14 | createCanvas(400, 400); 15 | background(0, 255, 0); 16 | 17 | soundFile.loop(); 18 | createP('Press any key to pause. Resume when the key is released') 19 | } 20 | 21 | function keyTyped() { 22 | soundFile.pause(); 23 | background(255, 0, 0); 24 | } 25 | 26 | function keyReleased() { 27 | soundFile.play(); 28 | background(0, 255, 0); 29 | } 30 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp3/example_3_5.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 3-5: mousePressed and keyPressed 8 | function setup(){ 9 | createCanvas(200,200); 10 | background(255); 11 | } 12 | 13 | function draw(){ 14 | // Nothing happens in draw() in this example! 15 | } 16 | 17 | // Whenever a user clicks the mouse the code written inside mousePressed() is executed. 18 | function mousePressed() { 19 | stroke(0); 20 | fill(175); 21 | rectMode(CENTER); 22 | rect(mouseX,mouseY,16,16); 23 | } 24 | 25 | // Whenever a user presses a key the code written inside keyPressed() is executed. 26 | function keyPressed() { 27 | background(255); 28 | } -------------------------------------------------------------------------------- /test/manual-test-examples/addons/p5.sound/Reverb_basic/sketch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Example: Reverb 3 | */ 4 | 5 | var sound, reverb; 6 | 7 | function preload() { 8 | soundFormats('mp3', 'ogg'); 9 | soundFile = loadSound('../_files/Damscray_-_Dancing_Tiger_02'); 10 | 11 | // disconnect the default connection 12 | // so that we only hear the sound via the reverb.process 13 | soundFile.disconnect(); 14 | } 15 | 16 | function setup() { 17 | createCanvas(720,100); 18 | background(0); 19 | 20 | reverb = new p5.Reverb(); 21 | 22 | // sonnects soundFile to reverb with a 23 | // reverbTime of 6 seconds, decayRate of 0.2% 24 | reverb.process(soundFile, 6, 0.2); 25 | 26 | reverb.amp(3); // turn it up! 27 | } 28 | 29 | function mousePressed() { 30 | soundFile.play(); 31 | } -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp1/example_1_4.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 1-4: Alpha Transparency 8 | 9 | function setup(){ 10 | createCanvas(200,200); 11 | noStroke(); 12 | }; 13 | 14 | function draw(){ 15 | 16 | background(0); 17 | 18 | // No fourth argument means 100% opacity. 19 | fill(0,0,255); 20 | rect(0,0,100,200); 21 | 22 | // 255 means 100% opacity. 23 | fill(255,0,0,255); 24 | rect(0,0,200,40); 25 | 26 | // 75% opacity. 27 | fill(255,0,0,191); 28 | rect(0,50,200,40); 29 | 30 | // 55% opacity. 31 | fill(255,0,0,127); 32 | rect(0,100,200,40); 33 | 34 | // 25% opacity. 35 | fill(255,0,0,63); 36 | rect(0,150,200,40); 37 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp6/example_6_3.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 6-3: While loop 8 | 9 | var y = 80; // Vertical location of each line 10 | var x = 50; // Initial horizontal location for first line 11 | var spacing = 10; // How far apart is each line 12 | var len = 20; // Length of each line 13 | var endLegs = 150; // A variable to mark where the legs end. 14 | 15 | 16 | function setup(){ 17 | createCanvas(200,200); 18 | background(255); 19 | stroke(0); 20 | }; 21 | 22 | function draw(){ 23 | // Draw each leg inside a while loop. 24 | while (x <= endLegs) { 25 | line (x,y,x,y + len); 26 | x = x + spacing; 27 | } 28 | }; -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp10/example_10_4/example_10_4.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // example 10-4: Implementing a timer 8 | 9 | var savedTime; 10 | var totalTime = 5000; 11 | 12 | function setup(){ 13 | createCanvas(200,200); 14 | background(0); 15 | savedTime = millis(); 16 | }; 17 | 18 | function draw(){ 19 | // Calculate how much time has passed 20 | var passedTime = millis() - savedTime; 21 | // Has five seconds passed? 22 | if (passedTime > totalTime) { 23 | print( " 5 seconds have passed! " ); 24 | background(random(255)); // Color a new background 25 | savedTime = millis(); // Save the current time to restart the timer! 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /test/manual-test-examples/learningprocessing/chp6/example_6_8.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Ported by Lauren McCarthy 6 | 7 | // Example 6-8: Lines one at a time 8 | 9 | // No for loop here. Instead, a global variable. 10 | var y = 0; 11 | 12 | function setup(){ 13 | createCanvas(200,200); 14 | background(255); 15 | // Slowing down the frame rate so we can easily see the effect. 16 | setFrameRate(5); 17 | }; 18 | 19 | function draw(){ 20 | // Draw a line 21 | stroke(0); 22 | // Only one line is drawn each time through draw(). 23 | line(0,y,width,y); 24 | // Increment y 25 | y += 10; 26 | 27 | // Reset y back to 0 when it gets to the bottom of window 28 | if (y > height) { 29 | y = 0; 30 | } 31 | }; --------------------------------------------------------------------------------