Loading a sequence of images.

edited November 2017 in p5.js Library Questions

I've written this code however, nothing will show.

var frames = [];

function setup() { // put setup code here createCanvas(1000,1000); }

function draw() { loadFrames(); }

function loadFrames(){ for(var i=0; i <27 i++){ frames[i] = loadImage('images/k' + i + '.gif'); } }

I'm Fairly new at coding and P5.js. I have a folder called "images" and in that images folder I have K1, K2, K3 as images that are gifs. I'm trying to set frames[0] to K1.gif frames[1] to K2.gif and so on

Thank you

Tagged:
Sign In or Register to comment.