How do you combine canvases in p5j weather you overlap or organise them

#1

basically here it is the basic form of this thought. im considering instance mode being something, although i don’t get the error message for my first equation; note this for someone who knows nothing, but needs to learn all steps.

function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
}

function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
}
0 Likes

Can some one help me stack and navigate two canvases
#2

You can also consider using <iframe> containers, so you can keep the “global mode” approach: :framed_picture:

Developer.Mozilla.org/en-US/docs/Web/HTML/Element/iframe

0 Likes

#3

i decided on this

{dot.operator
function setup1() {
<iframe>
createCanvas(400, 400);
}

function draw() {
background(220);
}

{dot.operator
function setup2() {
<iframe>
createCanvas(400, 400);
}

function draw() {
background(220);
}

i still get a error plus i need to seperate the two page ive done it before but dont get it enough

0 Likes

#5

good one i walked into that

0 Likes

#6

i got this

{dot.operator
function setup() {
  createCanvas(400, 500);
}

function draw() {
<iframe1>background(220);
}

{dot.operator
function setup() {
  createCanvas(400, 400);
}

function draw() {
<iframe2>background(320);
  }
0 Likes

Can some one help me stack and navigate two canvases
#7

there seems to be a error per line is the diction incorrect

0 Likes

#8

i got this so far

{dot.operator
function setup1() {
iframe>createCanvas(400, 500);
}

function draw() {
background1(220);
}

{dot.operator
function setup2() {
iframe>createCanvas(400, 400);
}

function draw() {
background2(320);
}
0 Likes

#9

hi,
-A- is that the same code like
How do you combine canvases in p5j weather you overlap or organise them ?
so why you open a new topic?

-B- pls repair / edit your post
with pasting your code ( after formatting it in ?processing IDE? [ctrl][t] )
here into

</> code tag

-C-
can you explain ( as i never see that ? above my level ) what

{dot.operator

is that and where you get it from? and what it is supposed to do
and ( even if valid )
why you do not close it with }

0 Likes

#10

Please don’t put raw <iframe> html tags in your code, or in your forum posts. That is HTML, not p5.js / JavaScript. Please don’t do it.

If you must write html tags like iframe, write them without <>, or write them with a tick ` before and after the word, or write it in code wrapped in three ticks before and after all the lines: ```.

1 Like