thanks for the answer! i understood as i imagined that is not so simple. I think i have a lot of things to digest now...
Was just hacking on some code that has recentering built in. It's superugly and needs some CSS to really center the canvas but hopefully gets the point across. I am pretty new as in just started today to this whole processing.js thing so apologies in advance if mixing jQuery and Processing is a bad idea. Kinda have three different syntaxes going on there = mess.--<!DOCTYPE html><html><head><title>kinda ugly but works and gets the idea across</title><meta charset="utf-8"><script src="./processing-1.3.6.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script><script type="text/processing" data-processing-target="canvas_1">$(window).resize(reCenter);var myWidth=500;var myHeight=500;function reCenter(){size(window.innerWidth/2,window.innerHeight/2);x_coord=(window.innerWidth-myWidth)/2;y_coord=(window.innerHeight-myWidth)/2;$("#canvas_1").css({'right' : x_coord, 'top' : y_coord});}void setup(){reCenter(); //postion and size the canvas at startup}void draw(){background(255,0,0);}</script></head><body><canvas id="canvas_1" style="position:fixed; padding:5px"><!-- Insert fallback content here --></canvas></body></html>
You received this message because you are subscribed to the Google Groups "Processing.js" group.
To view this discussion on the web visit https://groups.google.com/d/msg/processingjs/-/xjrqHD-E2LoJ.
To post to this group, send email to proces...@googlegroups.com.
To unsubscribe from this group, send email to processingjs...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/processingjs?hl=en.