Im trying to do sprite animation in p5.
let spritesheet;
function setup() {
createCanvas(innerWidth, innerHeight);
spritesheet = loadImage('./spritesheet.png')
background(0)
}
function draw() {
let img = spritesheet.get(0, 0, 100, 100)
console.log(img)
image(img,0,0,100,100)
}
When the y
is 0
let img = spritesheet.get(0, 0, 100, 100)
It works fine but when I try to adjust values of z or y it breaks
let img = spritesheet.get(0, 100, 100, 100)
Here is the console log