Skip to content

background() in setup() does not persist #125

@SableRaf

Description

@SableRaf

In Processing (Java), calling background() inside setup() sets the initial canvas background, which remains visible unless explicitly changed in draw().

In libprocessing / mewnala, calling background() inside setup() appears to have no effect once draw() starts.

Example

from mewnala import *

def setup():
    size(600, 600)
    background(255)

def draw():
    fill(255, 0, 0)
    rect(100, 100, 200, 200)

run()

See screenshot below for output.

Expected behavior (Processing Java)

White background with a red rectangle drawn on top.

Actual behavior (libprocessing / mewnala)

Black background with a red rectangle, suggesting the background set in setup() is cleared or ignored when draw() runs.

Screenshot

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions