# Debug with Editor

**URL:** <https://discourse.processing.org/t/debug-with-editor/25327>\
**Category:** Coding Questions\
**Created:** [November 10, 2020, 5:34pm UTC](https://discourse.processing.org/t/debug-with-editor/25327 "2020-11-10T17:34:26Z")\
**Posts on this page:** 16\
**Page:** 4

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 15, 2020, 9:02pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/61 "2020-11-15T21:02:00Z")

</div>

Which Sketch? I have so many now.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 15, 2020, 9:04pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/62 "2020-11-15T21:04:59Z")

</div>

Or like here:

video runs on your canvas

```auto
function preload() {
  // preload() runs once
  c3 = loadImage('ps5.jpg')
  ps5video = createVideo('PS5 Trailer.mp4');
}

function setup() {
  createCanvas(720, 350);

  ps5video.position(width - 275, 90);
  ps5video.loop();

  c3.resize(115, 0);

  for (let i = 0; i < width / 10; i++) {
    particles.push(new Particle());
  }
}

function draw() {

```

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 15, 2020, 9:09pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/63 "2020-11-15T21:09:44Z")

</div>

Yes that is what I was after the blessed position. I thought I would have to do another canvass

> **[p5.js Web Editor](https://editor.p5js.org/cpattenwalker/sketches/J6-_wTJw5)**

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 15, 2020, 9:12pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/64 "2020-11-15T21:12:37Z")

</div>

And you see the video now?

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 15, 2020, 9:15pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/65 "2020-11-15T21:15:24Z")

</div>

Yes it plays now. It would be nice if I could show the preview before it starts though. The position was what I was struggling with so progress.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 15, 2020, 9:18pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/66 "2020-11-15T21:18:26Z")

</div>

> **[p5.js Web Editor](https://editor.p5js.org/Chrisir10/sketches/qcXLWlyws)**

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 15, 2020, 9:20pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/67 "2020-11-15T21:20:23Z")

</div>

Yes works. I need to write code to trigger when mouse pressed in that location and stops when also pressed.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 15, 2020, 9:29pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/68 "2020-11-15T21:29:50Z")

</div>

> [@cpw](#):
>
> I need to write code to trigger when mouse pressed in that location and stops when also pressed.

This

```auto

let playMy = true; // false respectively

function togglePlay() {
  if (playMy) {
    ps5video.pause();
    playMy = false;
  } else {
    ps5video.loop();
    playMy = true;
  }
}

```

and register the function in setup()

` ps5video.mouseClicked(togglePlay);`

(you can say ps5video.pause() or ps5video.loop in `setup()` afaik; set flag playMy accordingly initially)

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 15, 2020, 9:54pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/69 "2020-11-15T21:54:21Z")

</div>

> **[p5.js Web Editor](https://editor.p5js.org/cpattenwalker/sketches/J6-_wTJw5)**

I see. No need for any buttons.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 15, 2020, 9:54pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/70 "2020-11-15T21:54:53Z")

</div>

In this case not, no

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 15, 2020, 9:55pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/71 "2020-11-15T21:55:46Z")

</div>

Ok. How do I call other sketches in my other files?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 15, 2020, 9:57pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/72 "2020-11-15T21:57:25Z")

</div>

> [@cpw](#):
>
> I call other sketches in my other files?

should be easy, but I don’t know

please search the forum here

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 15, 2020, 9:58pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/73 "2020-11-15T21:58:05Z")

</div>

Sure. I will do. I will search for the other videos now. Have a good weekend what is left. You have been great help !!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 18, 2020, 11:02pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/74 "2020-11-18T23:02:59Z")

</div>

background video:

` background(ps5video.get());`

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 18, 2020, 11:16pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/75 "2020-11-18T23:16:03Z")

</div>

I tried just a background image. I will give this a try. Interesting it needed a .get()

---

<div class="post-metadata">

**Author:** ![cpw](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@cpw](https://discourse.processing.org/u/cpw)\
**Post date:** [November 18, 2020, 11:25pm UTC](https://discourse.processing.org/t/debug-with-editor/25327/76 "2020-11-18T23:25:11Z")

</div>

That worked 🙂 Thanks again. Plan to try and stitch together each screen now.

[Previous page](https://discourse.processing.org/t/debug-with-editor/25327.md?page=3)
