Skip to content

If a function prints an object with p5.Graphics object, the function won't print anything else #3330

Open
@VinkentLi

Description

@VinkentLi

p5.js version

1.11.1

What is your operating system?

Windows

Web browser and version

Chrome version: 132.0.6834.160

Actual Behavior

The program doesn't log anything, even though draw() calls console.log();

Expected Behavior

The program should log "test" and the obj object every frame.

Steps to reproduce

Steps:

  1. Create object with p5.Graphics object
  2. Try to print something in a function along with the object

Snippet:

let obj = {graphics: null};

function setup() {
  createCanvas(400, 400);
  obj.graphics = createGraphics(400, 400);
}

function draw() {
  background(220);
  console.log("test");
  console.log(obj);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugError or unexpected behaviors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions