2

I want to use a sketch written with PDE as a background to a webpage. Is this possible?

I tried using the sketch.pde file in this css code but no joy:

html {
background: url(sketch.pde) no-repeat center center fixed;

}

Update

I set the canvas up like this:

<canvas id="twit" data-processing-sources="twit.pde"
height="window.innerHeight-10"     
width="window.innerWidth" 
tabindex="0" 
style="image-rendering">
</canvas>

And then refer to the canvas in the .css using the -moz-element:

{background: -moz-element(#twit) no-repeat;}
Oliver Burdekin
  • 1,098
  • 2
  • 17
  • 36

1 Answers1

2

From what I know, .pde is a text file not an image file. Therefore it won't work as a background. The only ways I've seen pde displayed are with the canvas HTML element and a java applet but I have no experience doing it myself. This other SO question might be able to help out with making the canvas appear to be a background along with checking out the source of the processing-js main page to find out how they put it into the element.

Community
  • 1
  • 1
sparrow
  • 177
  • 2
  • 9