javascript - I am using processing.js in a web page with script tag. How can I change the height of the script tag? -
i have created script tag put in processing code. when put on website takes small fraction of web page despite having 1142 height.
<html> <head> <script type="text/javascript" src="processingjs/processing.js"></script> <script type="text/javascript" src="processingjs/init.js"></script> </head> <body> <script type="application/processing" height="1142" width="1142"> nostroke(); draw = function() { fill(mousex, mousey, 0); ellipse(mousex, mousey, 100, 100); }; </script><canvas></canvas> </body> </html>
like newtojs said in comment, need use setup()
, size()
functions.
more info available in the reference:
defines dimension of display window in units of pixels.
size()
function must first line insetup()
. ifsize()
not called, default size of window 100x100 pixels. system variableswidth
,height
set parameters passed size() function.
you should habit of doing research before post question. covered in pretty every processing , processing.js tutorial, little reading have gone long way here.
Comments
Post a Comment