Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FX2D only accepts last call to tint() for a given frame #8

Open
ZachSundberg opened this issue Mar 18, 2016 · 2 comments
Open

FX2D only accepts last call to tint() for a given frame #8

ZachSundberg opened this issue Mar 18, 2016 · 2 comments
Labels
help wanted Many hands make light work. Please help!

Comments

@ZachSundberg
Copy link

This sketch demonstrates the error:

PImage testImage;
int clicker = 200;
color[] colors = new color[8];

void setup()
{
  size(800, 100, FX2D);
  testImage = loadImage("test.png");
  imageMode(CENTER);

  colors[0] = color(0,0,0); // not used
  colors[1] = color(0,255,0);
  colors[2] = color(0,0,255);
  colors[3] = color(255,255,0);
  colors[4] = color(0,255,255);
  colors[5] = color(100,0,100);
  colors[6] = color(100,100,0);
  colors[7] = color(255,0,255);
}

void draw()
{
  clicker++;
  if (clicker>120)
  {
    for (int i=1; i<8; i++)
    {
      tint(colors[i]);
      image(testImage, i*100, 50, 50, 50);
    }
    clicker=0;
  }
}

We should see 7 differently tinted images. Instead all seven are tinted to colors[7]. Change the size call to

size(800, 100, P2D);

And the bug goes away.

@ZachSundberg
Copy link
Author

Has anybody seen this?

@mikeaustin
Copy link

Yes, I was happy with FX2D performance, but then I implemented different colored particles, and they all only change color every few seconds, instead of every particle changing color. Guess I'll go back to P2D.

@benfry benfry transferred this issue from processing/processing Jan 16, 2022
@benfry benfry added the help wanted Many hands make light work. Please help! label Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Many hands make light work. Please help!
Projects
None yet
Development

No branches or pull requests

3 participants