FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

clear() is not defined · Issue #261 · processing-js/processing-js · GitHub

This repository was archived by the owner on Dec 5, 2018. It is now read-only.

Repository navigation

This repository was archived by the owner on Dec 5, 2018. It is now read-only.

clear() is not defined #261

Open
Open

Description

The clear() function clears a pixels buffer. Even if this buffers concept doesn't exist in Processing.js, adding a function that does nothing will be better than having code examples that won't run.

clear() is not defined

https://processing.org/reference/clear_.html

Activity

  1. Pomax commented on Sep 4, 2016

    Member

    odd that it's not in already, given that PGraphics is supported (at least the Processing 2.0 API version). Marking as good first bug.

  2. JamesWClark commented on Sep 4, 2016

    Author

    This is the code snippet I was looking at.

    background(500);
    clear();
    rect(50, 60, 70, 100);
    size(100, 100);
    arc(50, 60, 90, 80, 80, 100);
    

    In the above example, I can try to instantiate a Processing object and catch its error and use it on my page.

    try {
        new Processing(canvas, code);
    } catch (err) {
        $('#error-message').html(err);
    }
    

    Then used in setup and draw as below, an error message is not thrown that I can catch. The error message generated below is logged in the browser console from processing.min.js:896, version 1.6.0. I am not able to catch this one using the same code as above.

    void setup() {
        size(200,200,P3D);
    }
    void draw() {
        clear();
        box(125,125,125);
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL