<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with size() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=size%28%29</link>
      <pubDate>Sun, 08 Aug 2021 21:21:01 +0000</pubDate>
         <description>Tagged with size() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedsize%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Moving existing from Processing 2 to 3: error with size(1350,1080);</title>
      <link>https://forum.processing.org/two/discussion/28013/moving-existing-from-processing-2-to-3-error-with-size-1350-1080</link>
      <pubDate>Wed, 23 May 2018 19:29:24 +0000</pubDate>
      <dc:creator>Pinto318</dc:creator>
      <guid isPermaLink="false">28013@/two/discussions</guid>
      <description><![CDATA[<p>error: cannot be used here.<br />
void setup() {
         size(1350,1080);</p>
]]></description>
   </item>
   <item>
      <title>Can i create a mask from a shape??</title>
      <link>https://forum.processing.org/two/discussion/27757/can-i-create-a-mask-from-a-shape</link>
      <pubDate>Fri, 13 Apr 2018 17:54:32 +0000</pubDate>
      <dc:creator>RafaelAzevedo</dc:creator>
      <guid isPermaLink="false">27757@/two/discussions</guid>
      <description><![CDATA[<p>Hello!</p>

<p>Can i create a mask from a shape (in this case an ellipse) and change background color but keep the mask untouched?
This ellipse would have its size changed according to the screen and i would have a function windowResized()</p>

<p><img src="https://i.imgur.com/qxNRnXB.jpg" alt="image" /></p>

<p>Thanks! :)</p>
]]></description>
   </item>
   <item>
      <title>Why should size() call be the first line in setup()?</title>
      <link>https://forum.processing.org/two/discussion/20587/why-should-size-call-be-the-first-line-in-setup</link>
      <pubDate>Wed, 01 Feb 2017 08:49:31 +0000</pubDate>
      <dc:creator>Lord_of_the_Galaxy</dc:creator>
      <guid isPermaLink="false">20587@/two/discussions</guid>
      <description><![CDATA[<p>The title says it all.<br />
Most of us here know that <code>size()</code> must be the first call in <code>setup()</code>. <a href="/two/profile/PhiLho">@PhiLho</a> also says</p>

<blockquote class="Quote">
  <p>... the rule saying that the size() call must be the first one in setup(). For some reason, code before it tends to be run twice, which is annoying when loading a possibly large file.</p>
</blockquote>

<p>But why does that occur? Is it because <code>size()</code> internally calls <code>setup()</code> again after setting the size of the sketch, and subsequent calls to <code>size()</code> just skip right through to end?</p>
]]></description>
   </item>
   <item>
      <title>Edges showing in triangle strip</title>
      <link>https://forum.processing.org/two/discussion/25729/edges-showing-in-triangle-strip</link>
      <pubDate>Wed, 27 Dec 2017 15:17:40 +0000</pubDate>
      <dc:creator>glennmarshall</dc:creator>
      <guid isPermaLink="false">25729@/two/discussions</guid>
      <description><![CDATA[<p>I have an issue when drawing a triangle strip with no stroke - the edges of the polygons are slightly visible.</p>

<p>By changing to P2D render it works fine in Processing, but I need it to work in Processing.js, where the problem persists.</p>

<p>Here's a link to a sketch to show the problem
<a href="http://studio.sketchpad.cc/sp/pad/view/P0CunpgdMc/rev.7" target="_blank" rel="nofollow">http://studio.sketchpad.cc/sp/pad/view/P0CunpgdMc/rev.7</a></p>

<p>I know this is a processing.js issue but the processing.js google forum seems inactive.</p>

<p>Thanks for any help on this..</p>
]]></description>
   </item>
   <item>
      <title>"size cannot be used here" / loading images in settings()</title>
      <link>https://forum.processing.org/two/discussion/25270/size-cannot-be-used-here-loading-images-in-settings</link>
      <pubDate>Wed, 29 Nov 2017 14:10:22 +0000</pubDate>
      <dc:creator>pacoruiz</dc:creator>
      <guid isPermaLink="false">25270@/two/discussions</guid>
      <description><![CDATA[<p>Hi, Im executing this code and find this error: "size cannot be used here"</p>

<pre><code>PImage img;
PImage picture;
Integer[] palette;

void setup(){
  img = loadImage("palette.jpg");
  palette = getPalette(img);
  picture = loadImage("picture.jpg");
  size(picture.width,picture.height);
  background(255);
}

void draw(){
  colour(picture, palette);
  noLoop();
} 
</code></pre>
]]></description>
   </item>
   <item>
      <title>how to display the rectangle - first step in programing?</title>
      <link>https://forum.processing.org/two/discussion/24313/how-to-display-the-rectangle-first-step-in-programing</link>
      <pubDate>Fri, 29 Sep 2017 20:35:27 +0000</pubDate>
      <dc:creator>somou</dc:creator>
      <guid isPermaLink="false">24313@/two/discussions</guid>
      <description><![CDATA[<p>hi,
I am a beginner in processing, I installed processing3, In the sketch blank screen I typed rect(250,200,150,100); and then clicked the run arrow, it opened up the canvas of size 2inch by 2inch but I can't see the rectangle. is it something I am missing? it was the same case when I type ellipse(250,200,150,100); if this is due to the default canvas size then can I set the canvas size I my case to see the rectangle and the ellipse as in the Hello tutorial.
Thanks
Somou</p>
]]></description>
   </item>
   <item>
      <title>Using P3D changes the size of my sketch on Windows and not MAC</title>
      <link>https://forum.processing.org/two/discussion/23300/using-p3d-changes-the-size-of-my-sketch-on-windows-and-not-mac</link>
      <pubDate>Mon, 03 Jul 2017 18:01:08 +0000</pubDate>
      <dc:creator>alexlustigman</dc:creator>
      <guid isPermaLink="false">23300@/two/discussions</guid>
      <description><![CDATA[<p>While using the P3D or P2D renderer the size of my sketch changes from the size I set it to. For example if I put a width of 105 it will jump up to 160 when I run the sketch. This problem happens on other Windows computers. While running the exact same sketch on a mac the problem doesn't occur. Only the width changes.</p>
]]></description>
   </item>
   <item>
      <title>GL video 1.2.1</title>
      <link>https://forum.processing.org/two/discussion/21587/gl-video-1-2-1</link>
      <pubDate>Fri, 24 Mar 2017 17:21:04 +0000</pubDate>
      <dc:creator>RaulF</dc:creator>
      <guid isPermaLink="false">21587@/two/discussions</guid>
      <description><![CDATA[<p>Hi there!</p>

<p>I have installed the last GL video version, to see if I can solve my "jump" problems (<a href="https://forum.processing.org/two/discussion/13673/jump-in-videolibrary-causes-java-error#latest" target="_blank" rel="nofollow">https://forum.processing.org/two/discussion/13673/jump-in-videolibrary-causes-java-error#latest</a>).</p>

<p>But, with version 1.2.1 playing the videos the image freezes constantly.</p>

<p>I'm testing it in 5 different Raspberry at the same time, with the same results (253% CPU!). All software updated.</p>

<pre><code>PID USER      PR  NI    VIRT    RES       SHR S    %CPU  %MEM     TIME+ COMMAND                 
1033 pi        20   0  457288  91032  13084 S 253.2 23.2 351:44.38 java 
</code></pre>

<p>I'm also playing the same video file in 8 Raspberry, same hardware and software, but with GL video 1.2. Better performance:</p>

<pre><code>PID USER      PR  NI    VIRT    RES        SHR S      %CPU   %MEM   TIME+ COMMAND                 
1069 pi         0 -20  371956  58540  12232 S  48.3 14.9 136:07.68 java   
</code></pre>

<p>Video file:</p>

<p>Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 800x480, 9462 kb/s, SAR 1:1 DAR 5:3, 60 fps, 60 tbr, 60 tbn, 120 tbc (default)<br />
Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 1 channels, s16, 768 kb/s (default)</p>

<p>Any help is welcome!</p>

<p>Best.</p>
]]></description>
   </item>
   <item>
      <title>size() not working in a different tab?</title>
      <link>https://forum.processing.org/two/discussion/21821/size-not-working-in-a-different-tab</link>
      <pubDate>Wed, 05 Apr 2017 09:49:44 +0000</pubDate>
      <dc:creator>Helis</dc:creator>
      <guid isPermaLink="false">21821@/two/discussions</guid>
      <description><![CDATA[<p>Hey there.
I'm new to processing, so pardon me if it's a dumb question, but I'm kinda dumbfounded.</p>

<p>So, I'm following D. Shiffman's "Nature of Code" course on Youtube.</p>

<pre><code>class Mover {

  PVector position;
  PVector velocity;
  PVector acceleration;
  float mass;

  Mover() {
    position = new PVector(random(width), 0);
    velocity = new PVector(0,0);
    acceleration = new PVector(0,0);
    mass = random(0.5, 4);
  }

  void applyForce(PVector force) {
     PVector f = PVector.div(force, mass);
     acceleration.add(f);
  }

  void update() {
    velocity.add(acceleration);
    position.add(velocity);
    acceleration.mult(0);
  }

  void display() {
    stroke(0);
    fill(127);
    ellipse(position.x,position.y, mass * 20, mass * 20);
  }

  void checkEdges() {

    if (position.x &gt; width) {
      position.x = width;
      velocity.x *= -1;
    } else if (position.x &lt; 0) {
      velocity.x *= -1;
      position.x = 0;
    }

    if (position.y &gt; height) {
      velocity.y *= -1;
      position.y = height;
    }

  }

}

Mover[] movers;


void setup() {
  size(640, 360);
  movers = new Mover[5];
  for(int i = 0; i &lt; movers.length; i++) {
    movers[i] = new Mover();
  }
}

void draw() {
   background(255);

  for(Mover m: movers) {
    PVector gravity = new PVector(0, 0.3);
    gravity.mult(m.mass);
    m.applyForce(gravity);



    if(mousePressed) {
      PVector friction = m.velocity.copy();
      friction.normalize();
      friction.mult(-1);
      float c = 0.1;
      friction.mult(c);
      m.applyForce(friction);
    }


    m.update();
    m.checkEdges();
    m.display();
  }
}
</code></pre>

<p>This example works perfectly fine when placed in a single tab. But then I decided to leave the class in one tab and the rest of the stuff in another one. And as soon as my setup() gets moved to a new tab, I get an error "size() cannot be used here" when trying to run the sketch.</p>

<p>Processing considers multiple tabs to be just one big file, doesn't it? So how does this make sense?</p>
]]></description>
   </item>
   <item>
      <title>Android App only 100x100.</title>
      <link>https://forum.processing.org/two/discussion/18022/android-app-only-100x100</link>
      <pubDate>Tue, 30 Aug 2016 19:46:00 +0000</pubDate>
      <dc:creator>philofthejungle</dc:creator>
      <guid isPermaLink="false">18022@/two/discussions</guid>
      <description><![CDATA[<p>Hey,
I'm having a problem where my standard canvas size (without size() method) is only 100x100, and I also can't change it with size().
On a new sketch with size() and background() set it works, but not with my app. I also tried to comment out basically everything. Didn't have this problem before. I think it started when I updated processing and android-mode.
Can someone help?
cheers</p>
]]></description>
   </item>
   <item>
      <title>Who do I get size() cannot be used here ?</title>
      <link>https://forum.processing.org/two/discussion/21294/who-do-i-get-size-cannot-be-used-here</link>
      <pubDate>Thu, 09 Mar 2017 19:57:06 +0000</pubDate>
      <dc:creator>gek07</dc:creator>
      <guid isPermaLink="false">21294@/two/discussions</guid>
      <description><![CDATA[<pre><code>class Slider 
{ 
  Slider mySlider ;

  int  x, y ,w=180,h = 10 ,rctx;
  boolean locked ;
  Slider (int x , int y  ){
    rctx=x;
    this.x = x ;
    this.y = y ;
    locked = true ; }

    void lock () 
    {
      locked = true ; 
    }
     void unlock ()
     {if (mouseX&gt;=x-w/2 &amp;&amp; mouseX&lt;= x+w/2 &amp;mouseY&gt;= y-h/2 &amp;&amp; mouseY&lt;= y+h/2)
     locked = false;
     }
     void drag() 
 {
       if (locked==false)
       {x=mouseX;
       }
     }
     void display()
     { 
     x=constrain (x,rctx,rctx+w);
      rect(rctx,y,180,10);
      fill(128,128,128);
      ellipse(x,y,20,20);
     }}
Slider mySlider ;
void setup()
{  size(300, 100);
   mySlider = new Slider (10,10);
   mySlider.lock();}

  void draw()
  { 
    background (255);
    mySlider.display();

  }

    void mousePressed()
    {
    mySlider.unlock();}
    void mouseDragged()
    {
    mySlider.drag();}
    void mouseReleased()
    {
    mySlider.lock();}
</code></pre>

<p>Basic slider class and driver the code runs with a small window .For any value larger than (100 100) I get a weird message
about size() cannot be used here .</p>
]]></description>
   </item>
   <item>
      <title>size() variable error</title>
      <link>https://forum.processing.org/two/discussion/21314/size-variable-error</link>
      <pubDate>Fri, 10 Mar 2017 16:42:37 +0000</pubDate>
      <dc:creator>Frey</dc:creator>
      <guid isPermaLink="false">21314@/two/discussions</guid>
      <description><![CDATA[<p>Hi, I want to set the size based on an image dimensions.</p>

<p>What am I doing wrong?
<a rel="nofollow" href="https://forum.processing.org/two/uploads/imageupload/445/ODGZGEL7YGYB.jpg" title="Error">Error</a></p>

<p>(if I print the value, it's ok).</p>

<p>def setup():</p>

<pre><code> photo = loadImage("Photo.jpg")
 print(photo.height)
 image(photo, 0, 0)
</code></pre>

<p>Thank you!</p>
]]></description>
   </item>
   <item>
      <title>Problem with 3.x - Pimage and size() - Errors</title>
      <link>https://forum.processing.org/two/discussion/12079/problem-with-3-x-pimage-and-size-errors</link>
      <pubDate>Fri, 14 Aug 2015 10:32:52 +0000</pubDate>
      <dc:creator>BigFred</dc:creator>
      <guid isPermaLink="false">12079@/two/discussions</guid>
      <description><![CDATA[<p>I have just updated my processing to Processing 3.x, but loads of my sketches have stopped working. e.g:</p>

<p>CODE:</p>

<p><code>void setup() {
      background(33);
      source = loadImage("5.jpg");
      size(source.width, source.height);
    }</code></p>

<p>ERROR:
"The size of this sketch could not be determined from your code....."</p>

<p>any idea how I can set the size of the sketch to the PImage size?</p>
]]></description>
   </item>
   <item>
      <title>How to set size() before running the Applet?</title>
      <link>https://forum.processing.org/two/discussion/19747/how-to-set-size-before-running-the-applet</link>
      <pubDate>Wed, 14 Dec 2016 17:41:04 +0000</pubDate>
      <dc:creator>ardias</dc:creator>
      <guid isPermaLink="false">19747@/two/discussions</guid>
      <description><![CDATA[<p>Hello,
I'm trying to set the size of my sketch via Java-Properties read from a configuration file.
So the code for that has to be executed before settings() and setup(). Is this even possible in processing?</p>
]]></description>
   </item>
   <item>
      <title>"Size() cannot be used here" Error for "size (800, 600, P3D)"</title>
      <link>https://forum.processing.org/two/discussion/18521/size-cannot-be-used-here-error-for-size-800-600-p3d</link>
      <pubDate>Wed, 12 Oct 2016 18:25:48 +0000</pubDate>
      <dc:creator>grapher85</dc:creator>
      <guid isPermaLink="false">18521@/two/discussions</guid>
      <description><![CDATA[<p>I am new to Processing.  I picked up the book Processing: A Programming Handbook for Visual Designers and Artists so started going through that.  I have been trying out code that I have come across from others and had an error, that I wanted to ask the forum for help.  I am running Processing 3.2.1 on Windows 10 but getting an error on the below code "size (800, 600, P3D)" the window at bottom says size() cannot be user here.  If someone can kindly review the below code and let me know what needs to be changed, I would greatly appreciate it.  Thanks
<a rel="nofollow" href="https://dribbble.com/shots/1754428-Wave">https://dribbble.com/shots/1754428-Wave</a> <img src="" alt="" /></p>

<p>Code below</p>

<pre><code>            // by d whyte

int[][] result;
float t;

float ease(float p) {
  return 3*p*p - 2*p*p*p;
}

float ease(float p, float g) {
  if (p &lt; 0.5) 
    return 0.5 * pow(2*p, g);
  else
    return 1 - 0.5 * pow(2*(1 - p), g);
}

float mn = .5*sqrt(3);

void setup() {
  setup_();
  result = new int[width*height][3];
}

void draw() {

  if (!recording) {
    t = mouseX*1.0/width;
    draw_();
  } else {
    for (int i=0; i&lt;width*height; i++)
      for (int a=0; a&lt;3; a++)
        result[i][a] = 0;

    for (int sa=0; sa&lt;samplesPerFrame; sa++) {
      t = map(frameCount-1 + sa*shutterAngle/samplesPerFrame, 0, numFrames, 0, 1);
      draw_();
      loadPixels();
      for (int i=0; i&lt;pixels.length; i++) {
        result[i][0] += pixels[i] &gt;&gt; 16 &amp; 0xff;
        result[i][1] += pixels[i] &gt;&gt; 8 &amp; 0xff;
        result[i][2] += pixels[i] &amp; 0xff;
      }
    }

    loadPixels();
    for (int i=0; i&lt;pixels.length; i++)
      pixels[i] = 0xff &lt;&lt; 24 | 
        int(result[i][0]*1.0/samplesPerFrame) &lt;&lt; 16 | 
        int(result[i][1]*1.0/samplesPerFrame) &lt;&lt; 8 | 
        int(result[i][2]*1.0/samplesPerFrame);
    updatePixels();

    saveFrame("f###.gif");
    if (frameCount==numFrames)
      exit();
  }
}

//////////////////////////////////////////////////////////////////////////////

int samplesPerFrame = 16;
int numFrames = 96;        
float shutterAngle = .5;

boolean recording = true;

void setup_() {
  size(800, 600, P3D);
  smooth(8);
  rectMode(CENTER);
  stroke(70,150,200);
  noFill();
  strokeWeight(2);
}

float x, y, z, tt;
int N = 24, M = 16;
float l = 500, w = 320;
int n = 120;
float h = 120;
float q = 0.00011, ll = .000035;

void draw_() {
  background(250); 
  pushMatrix();
  translate(width/2, height/2 - 25);
  rotateX(PI*.24);
  for (int i=0; i&lt;N; i++) {
    x = map(i, 0, N-1, -l/2, l/2);
    strokeWeight(1.6);
    if(i==0 || i==N-1)
      strokeWeight(4);
    beginShape();
    for (int j=0; j&lt;n; j++) {
      y = map(j, 0, n-1, -w/2-1, w/2+1);
      z = h*sin(TWO_PI*t - q*(x*x + y*y))*exp(-ll*(x*x + y*y));
      vertex(x, y, z);
    }
    endShape();
  }
  for (int i=0; i&lt;M; i++) {
    y = map(i, 0, M-1, -w/2, w/2);
    strokeWeight(1.6);
    if(i==0 || i==M-1)
      strokeWeight(4);
    beginShape();
    for (int j=0; j&lt;n; j++) {
      x = map(j, 0, n-1, -l/2-1, l/2+1);
      z = h*sin(TWO_PI*t - q*(x*x + y*y))*exp(-ll*(x*x + y*y));
      vertex(x, y, z);
    }
    endShape();
  }
  popMatrix();
}
</code></pre>

<p><img src="https://forum.processing.org/two/uploads/imageupload/768/QG17EZBPW5LO.png" alt="2016-10-12_164700" title="2016-10-12_164700" /></p>
]]></description>
   </item>
   <item>
      <title>Eclipse Not Changing Size</title>
      <link>https://forum.processing.org/two/discussion/18286/eclipse-not-changing-size</link>
      <pubDate>Sun, 25 Sep 2016 07:23:34 +0000</pubDate>
      <dc:creator>Zac</dc:creator>
      <guid isPermaLink="false">18286@/two/discussions</guid>
      <description><![CDATA[<p>I just followed this tutorial - <a href="https://processing.org/tutorials/eclipse/" target="_blank" rel="nofollow">https://processing.org/tutorials/eclipse/</a> - to set up Processing in Eclipse. I used the Processing 2 core file as the imported core.</p>

<p>When I try and changed the size in settings it does not work but it does in setup. Why is this the case?</p>

<p>Thanks</p>
]]></description>
   </item>
   <item>
      <title>Setting img as background - Coordinate out of bounds</title>
      <link>https://forum.processing.org/two/discussion/18227/setting-img-as-background-coordinate-out-of-bounds</link>
      <pubDate>Wed, 21 Sep 2016 04:29:44 +0000</pubDate>
      <dc:creator>nach</dc:creator>
      <guid isPermaLink="false">18227@/two/discussions</guid>
      <description><![CDATA[<p>Hey guys, I'm trying to display and image as my background in the <code>void setup()</code> but it shows me the <em>ArrayIndexOutOfBoundException: Coordinate out of bounds!</em> error.
However, when I use <code>background(img);</code> in the <code>void draw()</code> , it works.</p>

<pre><code>PImage sourceImg;
int dw, dh;

void setup () {
  sourceImg = loadImage("test2.jpg");
  surface.setResizable(true);
  dw = sourceImg.width;
  dh = sourceImg.height;
  surface.setSize(dw, dh);
  background(sourceImg); //HERE IT GIVES ME THE ERROR
}

void draw() {
  //background(sourceImg); //HERE IT WORKS
}
</code></pre>

<p>I don't know how to fix this. I need the background image to be drawn one time at the start of the program. What does that error mean?</p>

<p>Thx in advance!</p>
]]></description>
   </item>
   <item>
      <title>How to set processing to automatically detect an image size and set it as a background?</title>
      <link>https://forum.processing.org/two/discussion/18033/how-to-set-processing-to-automatically-detect-an-image-size-and-set-it-as-a-background</link>
      <pubDate>Thu, 01 Sep 2016 14:42:54 +0000</pubDate>
      <dc:creator>testnia</dc:creator>
      <guid isPermaLink="false">18033@/two/discussions</guid>
      <description><![CDATA[<p>From my understanding, setting a background image in processing requires the size of the window to match the dimension of the image.</p>

<pre><code>PImage img = loadImage("background.jpg"); //a 100x100 background image.
size(100,100);
background(img);
</code></pre>

<p>However, since size() does not take in variables, how are we suppose to define a background with variable dimensions?</p>

<p>I have tested with the surface.setSize() function but it does not see to work.</p>

<p>Example:</p>

<pre><code>PImage img = loadImage("background.jpg"); //a 100x100 background image.
surface.setSize(img.width,img.height);
background(img);
</code></pre>
]]></description>
   </item>
   <item>
      <title>Processing doesn't let me use the size of the image for the size of the window</title>
      <link>https://forum.processing.org/two/discussion/17551/processing-doesn-t-let-me-use-the-size-of-the-image-for-the-size-of-the-window</link>
      <pubDate>Sat, 16 Jul 2016 17:01:57 +0000</pubDate>
      <dc:creator>cadavara</dc:creator>
      <guid isPermaLink="false">17551@/two/discussions</guid>
      <description><![CDATA[<p>I got the following code from a tutorial. I checked it with the reference and it should work.</p>

<p>The error I get is: "The size of this sketch could not be determined from your code. Use only numbers (not variables) for the size() command. Read the size() reference for more details.".</p>

<p><code>void setup(){
  PImage img = loadImage("image.jpg"); 
  size(img.width*2, img.height, P2D); 
  }</code></p>
]]></description>
   </item>
   <item>
      <title>size of drawing canvas</title>
      <link>https://forum.processing.org/two/discussion/17360/size-of-drawing-canvas</link>
      <pubDate>Wed, 29 Jun 2016 23:37:06 +0000</pubDate>
      <dc:creator>zak21</dc:creator>
      <guid isPermaLink="false">17360@/two/discussions</guid>
      <description><![CDATA[<p>Hi I am new to processing and just downloaded version 3.1 - I am trying to follow the tutorials on hello processing and ran the rect (250, 200, 150, 100); line but when the drawing canvas opens it is very small, cant be resized, and I dont see the rectangle in the canvas window. Can anyone give me a pointer as to what might be wrong ? also how do you toggle the rulers ? - cant see any obvious way to do that</p>
]]></description>
   </item>
   <item>
      <title>How to open a second window?</title>
      <link>https://forum.processing.org/two/discussion/16965/how-to-open-a-second-window</link>
      <pubDate>Fri, 03 Jun 2016 03:24:59 +0000</pubDate>
      <dc:creator>wsl1998</dc:creator>
      <guid isPermaLink="false">16965@/two/discussions</guid>
      <description><![CDATA[<p>I'm working on a project and I need to create a second window. Does anyone know how this can be done?</p>
]]></description>
   </item>
   <item>
      <title>Eclipse is Only Giving Small Window</title>
      <link>https://forum.processing.org/two/discussion/16991/eclipse-is-only-giving-small-window</link>
      <pubDate>Sat, 04 Jun 2016 18:26:13 +0000</pubDate>
      <dc:creator>Synan</dc:creator>
      <guid isPermaLink="false">16991@/two/discussions</guid>
      <description><![CDATA[<p>Hello. I'm trying to use the Processing Library in my Eclipse project, but it's only showing a small window. When I run the same code in the Processing 3 IDE, it shows the whole window. The only difference is that I have this in eclipse before the setup and draw:
public void setings(){
    size(1920, 1080, "processing.opengl.PGraphics3D");
}</p>

<p>instead of the same thing in the Startup of Processing. I can't find anyone else with this problem, though. And no matter how I change the size setting it doesn't effect the resulting window.</p>

<p>I can see the top left corner of what I'm trying to draw if that helps.
Thank you</p>
]]></description>
   </item>
   <item>
      <title>drawing shapes in setup() not working</title>
      <link>https://forum.processing.org/two/discussion/16515/drawing-shapes-in-setup-not-working</link>
      <pubDate>Mon, 09 May 2016 21:07:13 +0000</pubDate>
      <dc:creator>joliver</dc:creator>
      <guid isPermaLink="false">16515@/two/discussions</guid>
      <description><![CDATA[<p>Hi guys,</p>

<p>I'm working on a game currently and I'm trying to setup the playground with the setup() function of processing. I tried to break down the problem into easy code.</p>

<p>Consider the following sketch:</p>

<pre><code> void setup(){
     surface.setSize(300, 300);
     background(0);
     fill(255);
     rect(100, 100, 30, 30);
 }

 void draw(){
 }
</code></pre>

<p>When i execute this code, I'd expect a canvas of size=300x300 with black background and a white rectangle of size=30x30 at x=100 and y=100 on the canvas.</p>

<p>However the rectangle does not appear. Could anybody clarify why you can't draw rectangles in the setup function?</p>

<p>I'm using Processing 3.0.2</p>

<p>I've already looked at the processing references pages for:<br />
setup() : <a href="https://processing.org/reference/setup_.html" target="_blank" rel="nofollow">https://processing.org/reference/setup_.html</a><br />
background() : <a href="https://processing.org/reference/background_.html" target="_blank" rel="nofollow">https://processing.org/reference/background_.html</a><br />
rect() : <a href="https://processing.org/reference/rect_.html" target="_blank" rel="nofollow">https://processing.org/reference/rect_.html</a></p>

<p>It also appears to me that the reference page is not updated on all the issues that may break processing 2.0 code when updating on 3.0 <a href="https://github.com/processing/processing/wiki/Changes-in-3.0#things-that-may-break-your-2x-sketches" target="_blank" rel="nofollow">https://github.com/processing/processing/wiki/Changes-in-3.0#things-that-may-break-your-2x-sketches</a><br />
, so I'm not sure if I'm missing something.</p>

<p>I haven't found anything on this issue yet. Maybe I'm just misunderstanding the behavior of the setup function.</p>
]]></description>
   </item>
   <item>
      <title>Size method for intial window not working when more windows are are added.</title>
      <link>https://forum.processing.org/two/discussion/16457/size-method-for-intial-window-not-working-when-more-windows-are-are-added</link>
      <pubDate>Fri, 06 May 2016 08:08:07 +0000</pubDate>
      <dc:creator>HectorSmoke</dc:creator>
      <guid isPermaLink="false">16457@/two/discussions</guid>
      <description><![CDATA[<p>Recently I looked into making sketches with multiple windows and found some code online that allowed me to achieve this. The code I wrote based of the code I found online is below:</p>

<p>Tab 1:</p>

<pre><code>void setup() {
  size(500, 500);

  String[] args = {"TwoFrameTest"};
  SecondApplet sa = new SecondApplet();
  PApplet.runSketch(args, sa);

  ThirdApplet ta = new ThirdApplet();
  PApplet.runSketch(args, ta);
}

void draw() {
  background(0);
  ellipse(50, 50, 10, 10);
}    
</code></pre>

<p>Tab 2:</p>

<pre><code>public class SecondApplet extends PApplet {

  public void settings() {
    size(300, 300);
  }
  public void draw() {
    background(255);
    fill(0);
    ellipse(100, 50, 10, 10);
  }
}

public class ThirdApplet extends PApplet {

  public void settings() {
    size(400, 400);
  }
  public void draw() {
    background(255);
    fill(0);
    ellipse(100, 50, 10, 10);
  }
}
</code></pre>

<p>There is an issue however; when I run the code, the original window is displayed as its default size, even if a size method with different values is called. Strangely this even seems to happen if the other windows aren't called; the code in the second tab just has to be in the sketch folder and doesn't have to be referenced in any way. Does anybody have any idea what is happening and how I might fix it?</p>
]]></description>
   </item>
   <item>
      <title>Can't get size() to adapt to an image</title>
      <link>https://forum.processing.org/two/discussion/15545/can-t-get-size-to-adapt-to-an-image</link>
      <pubDate>Thu, 17 Mar 2016 17:14:08 +0000</pubDate>
      <dc:creator>ggongwer</dc:creator>
      <guid isPermaLink="false">15545@/two/discussions</guid>
      <description><![CDATA[<p>Sorry for the newbie question, but here goes:
I am trying to get the display size() to adjust to the loaded image. My code is the following:</p>

<p>void setup()
{
  img = loadImage("Typist.jpg");<br />
  size(img.width,img.height);              //set the window size to match the image
}</p>

<p>where "Typist.jpg" is in a "data" folder. I get the following error:</p>

<p>"The size of this image could not be determined from your code.
Use only numbers (not variables) for the size() command.
Read the size() reference for more details"</p>

<p>If I put numbers in in place of .width and .height it works just fine. I see lots of examples where code just like that works. 
Any suggestions? Thanks.</p>
]]></description>
   </item>
   <item>
      <title>Pixelpusher and size problem</title>
      <link>https://forum.processing.org/two/discussion/15269/pixelpusher-and-size-problem</link>
      <pubDate>Thu, 03 Mar 2016 21:33:58 +0000</pubDate>
      <dc:creator>Nagervold</dc:creator>
      <guid isPermaLink="false">15269@/two/discussions</guid>
      <description><![CDATA[<p>Hey everybody</p>

<p>I'm really new at processing - and i've run into my first problem:</p>

<p>Every test i try to run it says that i can't have variables in my size collumn. How do i change this? It says this in every file, do i need to download anything from the library?</p>

<p>Thanks a lot!</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/715/Y0FIWC1IVXGX.png" alt="Skærmbillede 2016-03-03 kl. 22.31.28" title="Skærmbillede 2016-03-03 kl. 22.31.28" /></p>
]]></description>
   </item>
   <item>
      <title>I can't size my window</title>
      <link>https://forum.processing.org/two/discussion/14422/i-can-t-size-my-window</link>
      <pubDate>Wed, 13 Jan 2016 04:15:29 +0000</pubDate>
      <dc:creator>ru14lv35</dc:creator>
      <guid isPermaLink="false">14422@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to change the size() of the window and I can't, it tells me I can't do that and to go check the references. But the problem is that I don't find anything wrong...
What can I do?</p>
]]></description>
   </item>
   <item>
      <title>My "display" of processing isn't working, why is that?</title>
      <link>https://forum.processing.org/two/discussion/13799/my-display-of-processing-isn-t-working-why-is-that</link>
      <pubDate>Sun, 06 Dec 2015 10:11:20 +0000</pubDate>
      <dc:creator>ricky</dc:creator>
      <guid isPermaLink="false">13799@/two/discussions</guid>
      <description><![CDATA[<p>I right my code, but when I run it the "display" comes out as a grey little square but doesn't show me anything, how can I solve it?? please help!!</p>
]]></description>
   </item>
   <item>
      <title>Use only numbers (not variables) for the size() command.</title>
      <link>https://forum.processing.org/two/discussion/12151/use-only-numbers-not-variables-for-the-size-command</link>
      <pubDate>Wed, 19 Aug 2015 06:47:23 +0000</pubDate>
      <dc:creator>MrPumpernickel</dc:creator>
      <guid isPermaLink="false">12151@/two/discussions</guid>
      <description><![CDATA[<p>Okay, this has thrown my head for a spin. When I'm running my sketch I'm loading an image using PImage, and using the dimensions from that image I set the size of the sketch. Like so:</p>

<pre><code>PImage image;

void setup() {
  image = loadImage("image.jpg");
  size(image.width, image.height);
}
</code></pre>

<p>However, running that under Processing 3.0 spits out the following:</p>

<p><em>The size of your sketch could not be determined from your code.
Use only numbers (not variables) for the size() command.
Read the size() reference for more details.</em></p>

<p>Now, from what I've figured out you need to use void settings() to use variables in size() but here is the catch 22: the image can be be loaded earliest in setup() and settings() need to be called before setup().</p>

<p>I.e. neither of the following code snippets are valid solutions:</p>

<pre><code>PImage image;

void settings() {
  image = loadImage("image.jpg");  // can't load image before setup()
  size(image.width, image.height);
}

void setup() {
}
</code></pre>

<p>nor:</p>

<pre><code>PImage image;

void setup() {
  image = loadImage("image.jpg");
}

void settings() {  // can't call settings() after setup()
  size(image.width, image.height);
}
</code></pre>

<p>Is there a way around this that I'm not seeing?</p>
]]></description>
   </item>
   <item>
      <title>Ok to use constants in call to size() in immediate mode?</title>
      <link>https://forum.processing.org/two/discussion/12105/ok-to-use-constants-in-call-to-size-in-immediate-mode</link>
      <pubDate>Sun, 16 Aug 2015 09:33:32 +0000</pubDate>
      <dc:creator>Jarmo</dc:creator>
      <guid isPermaLink="false">12105@/two/discussions</guid>
      <description><![CDATA[<p>Both the reference page for size() and the new book on Processing by Reas and Fry state that the call to size() must be the first line in code, or the first line in setup(). I am not sure how strict this rule is, because it's actually violated even in the book in an example on p. 300.</p>

<p>My question is: is it safe to specify the parameters to size() as constants, for example as follows:</p>

<p><code>final int H=100;
size (2*H, H);</code></p>

<p>This technique has worked in my tests, but is it safe?</p>

<p>I know that it would be possible to first define the constants outside setup(), and then use them as parameters to size() in setup(), but as a programming teacher I would like to introduce the use of constants before I introduce setup() and draw() and defining functions in general.</p>

<p>I have two reasons for wanting to specify parameters to size() as constants.</p>

<p>First, assume that the width:height ratio of the sketch should always be 2:1, but the actual size might change. Then good programming practice states that size should be specified as above, not by size(200,100), where you would have to change two values if size of the sketch were changed.</p>

<p>Second, I would prefer that the students specify the width and height of the sketch with their own constants, and use those constants in calculations at other places in the code, rather than the students using the internal variables "width" and "height".</p>
]]></description>
   </item>
   </channel>
</rss>