We are about to switch to a new forum software. Until then we have removed the registration on this forum.
For some reason, I cannot get a background image onto a sketch I'm working on. I followed the instructions here but it is not working: http://p5js.org/learn/examples/Image_Background_Image.php
I took out all my other code to just focus on this issue:
var bg;
function setup() {
bg = loadImage("img.jpg");
createCanvas(1024, 768);
}
function draw() {
background(bg);
}
Here is my image. It is located in the same folder as my index.html and sketch.js
Answers
Okay, is your image the same size as sizes that you put in create canvas?
@TechWiz777 - Yes, the image is 1024px wide and 768px high
Seems like those examples are too old and doesn't mention that we need to preload() them: :-?
http://p5js.org/reference/#/p5/preload