Skip to content

TweakMode defaults numeric class variables to 0 #17

Description

@KevinWorkman

Talking about this code:

MyClass myClass = new MyClass();

void setup() {
  size(100, 100);
}

void draw() {
  background(0);
  text(myClass.x, 50, 25);
  text(myClass.y, 50, 50);
  text(myClass.z, 50, 75);
}

class MyClass {
  int x = 123;
  float y = 123.0;
  String z = "testing";
}

If I run that using the plain old play button, I see this:

variables set correctly

However, if I run using Tweak Mode, I see this:

variables set incorrectly

It looks like Tweak Mode is defaulting numeric variables to 0 instead of the values given to them in the code. Is Tweak Mode expected to work with classes?

Note that I know that tweaking the values shouldn't do anything, but I would also expect their default values to be preserved.

This was originally reported on the Processing forum here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions