Modifying a renderer transparency affects the whole window...

Hi, my code is here: my sketch

I'm displaying a 'help pannel' when the sketch begins and on demand ('h' key), then fade it out inside draw():

function setup() { createCanvas(800, 800); frameRate(100); imageMode(CENTER); rectMode(CENTER); showhelp = true; helppannel = createGraphics(width / 2, height / 4); hpalpha = 512;...

function draw() { background(220); for (var i = 0; i < nhtiles * nvtiles; i++) { tileSystem[i].display(); } if (showhelp) { image(helppannel, width / 2, height / 2); var hptrans=(hpalpha - frameCount) * .5; helppannel.clear(); helppannel.background(255,hptrans); helppannel.textAlign(CENTER); helppannel.textSize(24); helppannel.fill(0, hptrans); helppannel.text(" hit 'h' or click to show/hide help \n 'space bar' to reset\n 'pageup'/'pagedown' to get\n more/less 'workers'", width / 4, height / 12); if(hptrans==0)showhelp=false; } }

It works but the whole window gets affected by my renderer background... I dont understand why. Sorry, I dont know much in JS! Is there a way to avoid this or a different way of doing that?

Thank you!

Tagged:

Answers

  • Your code is running fine when I copied it and ran on my local environment. I'm not sure what is causing the problem on openprocessing which I suspect might be some openprocessing related problem (got some code mix up or something). I'm not familiar enough with openprocessing enough to be sure.

    If you can, raise this issue with openprocessing, they might know what is going on a bit more

Sign In or Register to comment.