<?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 text() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=text%28%29</link>
      <pubDate>Sun, 08 Aug 2021 15:59:02 +0000</pubDate>
         <description>Tagged with text() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedtext%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>printing 2darray as text...</title>
      <link>https://forum.processing.org/two/discussion/25042/printing-2darray-as-text</link>
      <pubDate>Thu, 16 Nov 2017 09:02:16 +0000</pubDate>
      <dc:creator>SlimJimCantSwim</dc:creator>
      <guid isPermaLink="false">25042@/two/discussions</guid>
      <description><![CDATA[<p>Hi, i've searched for a while and I'm not sure if i'm missing something obvious, i'm trying to print a 2d integer array as text, i did it before but I can't remember how i did and it is driving me insane.</p>

<p>thanks.</p>

<pre><code>void setup() {

  size(300, 300);
  background(255);
  array();
}

void array() {

  int[][] arrayinit = {
    { 10, 5, 3, 55, 90 }, 
    {  9, 4, 2, 32, 22 }, 
    {  3, 8, 5, 79, 22 }, 
    {  3, 8, 45, 4, 2 }, 
    {  3, 22, 5, 44, 4 }
  };

  int rows = 5;
  int cols = 5;

  int[] sum = new int[cols];
  int[] sum2 = new int[rows];
  stroke(0);
  for (int c=0; c&lt;cols; c++) { // for every column
    for (int r=0; r&lt;rows; r++) { // for every row
      rect(40*r, 30*c, 40, 30);
      text(arrayinit[c][r], 40*r, 30*c); //dont know if this is right
      sum[c] += arrayinit[r][c]; // sum up the values per column
      sum2[r] += arrayinit[r][c];
    }
  }

  println(sum[0]); 
  println(sum[1]); 
  println(sum[2]); 
  println(sum2[2]);
  println(arrayinit[2][2]);
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>click (show text if mousePressed)</title>
      <link>https://forum.processing.org/two/discussion/27941/click-show-text-if-mousepressed</link>
      <pubDate>Tue, 08 May 2018 15:16:36 +0000</pubDate>
      <dc:creator>zilbe</dc:creator>
      <guid isPermaLink="false">27941@/two/discussions</guid>
      <description><![CDATA[<p>Hello, how to make that click on the mouse would be the text that appears</p>

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

void draw() {
  if (mousePressed == true) {
    if (mouseButton == LEFT) {
      fill(0); // Black
    } else if (mouseButton == RIGHT) {
      fill(255); // White
   }
 } else {
   fill(126); // Gray
 }
 rect(25, 25, 50, 50);
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>PGraphics text has ugly edges</title>
      <link>https://forum.processing.org/two/discussion/27841/pgraphics-text-has-ugly-edges</link>
      <pubDate>Tue, 24 Apr 2018 15:16:29 +0000</pubDate>
      <dc:creator>theliquu69</dc:creator>
      <guid isPermaLink="false">27841@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>I'm trying to draw text inside of a <code>PGraphics</code>, but it looks ugly. Code:</p>

<pre><code>PGraphics g;

void setup() {
  size(400, 400);

  g = createGraphics(width, height);

  g.beginDraw();
  g.fill(255);
  g.text("In PGraphics", 4, 48);
  g.endDraw();
}

void draw() {
  background(32);

  fill(255);
  text("In Draw", 4, 24);

  image(g, 0, 0);
}
</code></pre>

<p>Here's a screenshot:</p>

<p><img src="https://i.imgur.com/5uxf7FU.png" alt="screenshot" /></p>

<p>What's going wrong with this? I tried adding a <code>background(0)</code> call to the <code>PGraphics</code>, but it didn't help, because the background needs to be transparent. I am going to draw color in my final sketch, so I can't really use blending modes.</p>

<p>EDIT: Just providing more details: I need to use JAVA2D, because my sketch uses clip(), and P2D breaks clip() with transform().</p>
]]></description>
   </item>
   <item>
      <title>Label PieChart</title>
      <link>https://forum.processing.org/two/discussion/27781/label-piechart</link>
      <pubDate>Mon, 16 Apr 2018 18:12:15 +0000</pubDate>
      <dc:creator>res</dc:creator>
      <guid isPermaLink="false">27781@/two/discussions</guid>
      <description><![CDATA[<p>Hi,
i hope somebody could help me because i should do the Project for my work.
I created a pie Chart but i dont know how i can place the Label.</p>

<p>In the middle of the arc (outside the Circle) there should be the Label.</p>

<pre><code>for (Rohtipps g : myRohtipp) {

    //PVector c = randomVector(mapped);
    //draw ellipse
    PVector loc = g.getLocation();
    float dia = g.getDiameter();
    //noFill();

    float[] data={g.getColdlead(), g.getWarmlead(), g.getHotlead()};

    //float[] data={50.0, 50.0, 50.0, 50.0};
    float sumdata=0;
    for (int i=0; i&lt;data.length; i++) {
      sumdata+=data[i];
    }
    //println(sumdata);
    sumdata = 360/sumdata;

    for (int i=0; i&lt;data.length; i++) {
      data[i] = sumdata*data[i];
    }
    float lastAngle=0;

    for (int i=0; i&lt;data.length; i++) {
       float col=map(i, 0, data.length, 20, 255);
       fill(55, 150, col, col+100);
       noStroke();
       arc(loc.x, loc.y, dia, dia, lastAngle, lastAngle+radians(data[i]));
       lastAngle +=radians(data[i]);

    }

    //println(g.getKampagne()+" "+g.getColdlead()+" "+g.getWarmlead()+" "+g.getHotlead());
    //pieChart(dia, loc.x, loc.y, data);
    //ellipse(loc.x, loc.y, dia, dia);
    fill(40, 40, 40);
    //label positionieren
    textSize(11);


    float tw=(textWidth(g.getKampagne()))/2;
    text(g.getKampagne(), loc.x-tw, loc.y+30);

    //println(g.getAnzahl());
    ts=ts-2;
    textSize(ts);
    fill(30, 30, 30);
    text(g.getKampagne()+" "+g.getAnzahl(), 1400, g.getPositionText());
    textSize(24);
    //println(g.getColdlead());
  }
</code></pre>

<p>Thanks
Theresa</p>
]]></description>
   </item>
   <item>
      <title>Drawing characters and symbols</title>
      <link>https://forum.processing.org/two/discussion/27619/drawing-characters-and-symbols</link>
      <pubDate>Sun, 01 Apr 2018 19:23:08 +0000</pubDate>
      <dc:creator>solub</dc:creator>
      <guid isPermaLink="false">27619@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I'm trying to draw special characters / symbols with the <code>text()</code> function such as:</p>

<p>'■', '□', '▢', '▲', '△', '▼', '▽', '◆', '○', '●', 'Δ', 'ʊ', '™', '©', '®', '¿', '¡', '½', '⅓', '⅔', '¼', '¾', '⅛', '⅜', '⅝', '⅞', '℅', '№', '∃', '∩', '∀','Ξ', 'Γ', 'ɐ', 'ə', 'ɘ', 'ε', 'β', 'ɟ', 'ɥ', 'ɯ', 'ɔ', 'и', 'ɹ', 'ʁ', 'я', 'ʌ', 'ʍ', 'λ', 'ч', '∞', 'Σ', 'Π', 'η', 'α','·','¨','…', '¦', '┅', '┆', '┈', '┊',' ╱',' ╲', '╳', '¯', '–', '—','≡', '░', '▒', '▓', '█', '▌', '▐', '▀', '▄', '╭', '╮', '╯', '╰','│', '┤', '╡', '╢', '╖', '╕', '╣', '║', '╝', '╜',' ╛', '┐', '└', '┴', '┬', '├', '─', '┼', '╞', '╟', '╚', '╔', '╩', '╦', '╠', '═', '╬', '╧', '╨', '╤', '╥', '╙', '╘', '╒', '╓', '╫', '╪', '┘', '┌', 'Σ',  '♠', 'Ω', '♣', '♥', '♦', '☼', '☻'...</p>

<p>However most of them (90%) don't seem to be recognized. All I have instead is the letter 'â' printed on the screen.</p>

<p>Is there a way to draw all these symbols ?</p>

<p>Thanks</p>
]]></description>
   </item>
   <item>
      <title>Array index and item as drawn text</title>
      <link>https://forum.processing.org/two/discussion/26675/array-index-and-item-as-drawn-text</link>
      <pubDate>Tue, 06 Mar 2018 15:50:50 +0000</pubDate>
      <dc:creator>Leo_Aguiar</dc:creator>
      <guid isPermaLink="false">26675@/two/discussions</guid>
      <description><![CDATA[<p>Hi guys,</p>

<p>Is there a way to have an array's indexes and items be drawn as text? I couldn't find anything specific on this and I'm a beginner to intermediate coder.</p>

<p>I've tried something like the following in the draw function: text("myArray indexes and items:" + myArray_name, 25, 25);</p>

<p>But the text that is drawn isn't anything I can understand. It seems like it's a hexadecimal number and not the familiar [0] item0 , [1] item1, [2] item2, [n] itemn format.</p>

<p>Do I need to do some sort of conversion where the array is transformed in to a String before it goes into the text()?</p>

<p>Thanks for the help!</p>
]]></description>
   </item>
   <item>
      <title>I have problem with text(); help me someone</title>
      <link>https://forum.processing.org/two/discussion/3430/i-have-problem-with-text-help-me-someone</link>
      <pubDate>Mon, 03 Mar 2014 16:48:25 +0000</pubDate>
      <dc:creator>progreso</dc:creator>
      <guid isPermaLink="false">3430@/two/discussions</guid>
      <description><![CDATA[<p>first hallo and sorry if posted in wrong place but little confused where to post...</p>

<p>text function not working(working but very bed and strange)..so what I mean...</p>

<p>here simple code:</p>

<pre><code>void setup() {
  size(200, 200);
  background(0);
}
void draw() {
  text("It's Working",70,100);
}
</code></pre>

<p>problem is time, for this code to run its need about 2 minute and processor killing himself...after that finally text appears.. I do not know its Bug or something like that but on my machine its not working well, if someone knows wha tis this and how to solve it please tell me</p>

<p>// Intel Quad Core 2.5Ghz, Windows 8<br />
// Processing 2.1.1</p>

<p>here is test on "hallo precessing" page and its working quick and good
and second image is my machine and this is what is looks like before draw text</p>

<p>I have this problem only on text(); at this time....</p>

<p><img src="http://forum.processing.org/two/uploads/imageupload/622/4148BPGLK03J.jpg" alt="working" title="working" />
<img src="http://forum.processing.org/two/uploads/imageupload/315/1FZEGRB7C8PS.jpg" alt="notworking" title="notworking" /></p>
]]></description>
   </item>
   <item>
      <title>Why are text and graphics so ugly and blocky?</title>
      <link>https://forum.processing.org/two/discussion/8075/why-are-text-and-graphics-so-ugly-and-blocky</link>
      <pubDate>Tue, 11 Nov 2014 10:54:48 +0000</pubDate>
      <dc:creator>PhiLho</dc:creator>
      <guid isPermaLink="false">8075@/two/discussions</guid>
      <description><![CDATA[<h1>Why are text and graphics so ugly and blocky?</h1>

<p>Often in the forum we have similar questions:<br />
"<em>Why is the text so blocky?</em>"<br />
"<em>Why these lines are not anti-aliased?</em>"<br />
"<em>Why is this circle almost squarish?</em>"<br /></p>

<p>And when asked, the user shows code looking like:</p>

<pre lang="processing">
void setup()
{
  size(400, 400);
  background(255);
}

void draw()
{
  stroke(#000055);
  fill(#000055);

  ellipse(width / 2, height / 2, width / 10, height / 10);

  textSize(50);
  text("Blocky\nText", 100, 2 * height / 3);
  textSize(10);
  text("Other\nText", 20, height / 3);

  line(100, 50, 300, 150);
  line(150, 150, 350, 100);
}
</pre>

<p>If you are an experienced user, you immediately spot the problem, and advise to move the call to <code>background()</code> at the start of <code>draw()</code>;</p>

<pre lang="processing">
void setup()
{
  size(400, 400);
}

void draw()
{
  background(255);
  stroke(#000055);
  fill(#000055);

  ellipse(width / 2, height / 2, width / 10, height / 10);

  textSize(50);
  text("Blocky\nText", 100, 2 * height / 3);
  textSize(10);
  text("Other\nText", 20, height / 3);

  line(100, 50, 300, 150);
  line(150, 150, 350, 100);
}
</pre>

<p>In versions before 2.0, adding a call to <code>smooth()</code> helped, but it is the default now.</p>

<h3>Why does it makes a difference?</h3>

<p>Processing does its drawings in anti-aliased mode: the borders are smoothed by drawing semi-transparent, toned down pixels on the borders, making a nicer transition with the background.
<code>draw()</code> is called 60 times per second (by default). It doesn't erase the background if not asked explicitly. So it draws over and over the graphics at the same place. The semi-transparent pixels cumulate on the borders, so they progressively become completely opaque. Hence the blocky look with steps.</p>

<p>Nearly all the Processing sketches (except some special effects playing on the accumulation of graphics) start <code>draw()</code> with a call to <code>background()</code>. There can be exceptions, but they are the done by people understanding deeply how Processing works.</p>
]]></description>
   </item>
   <item>
      <title>How to wrap text?</title>
      <link>https://forum.processing.org/two/discussion/25628/how-to-wrap-text</link>
      <pubDate>Mon, 18 Dec 2017 17:01:13 +0000</pubDate>
      <dc:creator>randomdude</dc:creator>
      <guid isPermaLink="false">25628@/two/discussions</guid>
      <description><![CDATA[<p>So far I have been dealing with wrapping text by specifying its size inside 'if' statements, but there surely has to be a more convenient way. I have searched around the internet to no avail. Does anyone have a suggestions on how to wrap text inside a given space?</p>
]]></description>
   </item>
   <item>
      <title>Canvases automatically scale up</title>
      <link>https://forum.processing.org/two/discussion/24936/canvases-automatically-scale-up</link>
      <pubDate>Thu, 09 Nov 2017 18:19:15 +0000</pubDate>
      <dc:creator>Shoruke</dc:creator>
      <guid isPermaLink="false">24936@/two/discussions</guid>
      <description><![CDATA[<p>I have a program with size(1080, 800), which should fit comfortably on my 1920x1080 computer screen, and it does when I run it as a processing program, but when I use processing.js to load it in a web browser, everything gets blown up by like 1.5x. It doesn't fit on my screen anymore and the text looks like garbage from the upscaling. At least all the visuals still line up properly and I can click things just fine, but why is it upscaled?</p>

<p>I've fiddled around with the HTML on the webpage I'm using, and forcing the canvas to be a different size does change it proportionally to the change, but not to the actual correct size. I made sure to reset my zoom in Firefox, so that's not it. The same thing happens in Chrome, too.</p>

<p>Here, have a picture of a processing program displayed over that same program in a web browser. <img src="https://i.imgur.com/yKuSPlF.png" alt="" /></p>

<p>What causes this??? I'm not even 100% sure this is a problem with processing or processing.js, but I'm completely stumped. Is there a setting I've messed with in both Firefox and Chrome, somehow? Do web browsers just measure pixels differently from everything else on my computer? Is there some trick to the HTML5 canvas element I need to know? Whenever I try to Google this problem I get answers about How To Resize A Program, which I don't need.</p>

<p>(before anyone asks to see the source code, bear in mind it's some 3000 lines of code across 12 .pde files, with a 1.6MB data folder...)</p>
]]></description>
   </item>
   <item>
      <title>absolute begginer - animate multiple lines of text</title>
      <link>https://forum.processing.org/two/discussion/25001/absolute-begginer-animate-multiple-lines-of-text</link>
      <pubDate>Tue, 14 Nov 2017 11:21:31 +0000</pubDate>
      <dc:creator>vasques</dc:creator>
      <guid isPermaLink="false">25001@/two/discussions</guid>
      <description><![CDATA[<p>Hi.
I´m an absolute beginner in programming and p5.js. I got stuck in my project. Would you help me find out what´s wrong in this piece of code? I want the sentence to move from left to right, maintaining a constant y.</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/477/WQSYMB6WOHBV.jpg" alt="Sem Título-2" title="Sem Título-2" /></p>
]]></description>
   </item>
   <item>
      <title>How to get my loop items on a different line</title>
      <link>https://forum.processing.org/two/discussion/24973/how-to-get-my-loop-items-on-a-different-line</link>
      <pubDate>Sun, 12 Nov 2017 14:07:29 +0000</pubDate>
      <dc:creator>111aei</dc:creator>
      <guid isPermaLink="false">24973@/two/discussions</guid>
      <description><![CDATA[<p>Okay, so I finally figured out how to display my loop items as text, by running a simple loop, however, I don't know how to make them appear one under the other.</p>

<p>example_list= [1,2,3, 4, 5]</p>

<pre><code>for elements in example_list:
    text (elements , 50, 50)
</code></pre>

<p>I should note, that I tried to create a variable for y, that took in the number of items, but that didn't quite work</p>
]]></description>
   </item>
   <item>
      <title>Make text as large as possible, within boundary dimensions?</title>
      <link>https://forum.processing.org/two/discussion/24002/make-text-as-large-as-possible-within-boundary-dimensions</link>
      <pubDate>Sat, 02 Sep 2017 01:24:07 +0000</pubDate>
      <dc:creator>darinb</dc:creator>
      <guid isPermaLink="false">24002@/two/discussions</guid>
      <description><![CDATA[<p>Is there a way in Processing to autoscale the text size to the largest possible that will fit into the text box boundaries?</p>

<p>In my case, I want to display a string from a large set of strings onto the screen. They vary is length from two or three words to dozens.</p>

<p>I see in the reference that Text() will not display the text if it gets too large--is there deeper documentation for Text()--perhaps it sends an error code of some sort when it does this which I can then utilize by starting with very large font sizes (that will fail) and iteratively  getting smaller until it does fit? Or some other way?</p>

<p>I'm guessing this question has been asked before but I couldn't find anything via search.</p>
]]></description>
   </item>
   <item>
      <title>What happened to delay</title>
      <link>https://forum.processing.org/two/discussion/23906/what-happened-to-delay</link>
      <pubDate>Wed, 23 Aug 2017 20:59:44 +0000</pubDate>
      <dc:creator>StereoFrog</dc:creator>
      <guid isPermaLink="false">23906@/two/discussions</guid>
      <description><![CDATA[<p><img src="https://forum.processing.org/two/uploads/imageupload/709/UOG6IJGQM55A.png" alt="uwt" title="uwt" /></p>

<p>My head just hurts. If you do this it doesn't work right it just stuck until all letters are displayed and if you remove "while" it still doesn't work also x=1; is done so to test if in second draw re-run it works. You can actually fix this if you like moving entire app to side cuz when mouse holding app touches side of screen app works for that moment and it can't be still.</p>
]]></description>
   </item>
   <item>
      <title>special characters, renderers, fonts</title>
      <link>https://forum.processing.org/two/discussion/23672/special-characters-renderers-fonts</link>
      <pubDate>Wed, 02 Aug 2017 01:14:55 +0000</pubDate>
      <dc:creator>Introscopia</dc:creator>
      <guid isPermaLink="false">23672@/two/discussions</guid>
      <description><![CDATA[<p>So I needed to display some special characters (from the    Miscellaneous Symbols and Arrows block). I tried using arial with all unicode blocks, it didn't display, i tried making a font with the block explicitly included, didn't work.</p>

<p>I then switched to FX2D renderer, on a hunch, and it finally displayed my characters. This would be fine, except FX2D makes some other text that I have in a separate PGraphics look fuzzy. Notice how odd this is, the PGraphics object shouldn't be affected by the sketch renderer, it should just create an image equal to one rendered on default mode (I don't even have the option to render that PGraphics object with FX2D, it doesn't work yet, it's been an open issue since last year)</p>

<p>Is there something I'm missing or am I just going to have to tweak until either of these issues are solved in the core?</p>
]]></description>
   </item>
   <item>
      <title>Need help because processing can't read slovak</title>
      <link>https://forum.processing.org/two/discussion/23416/need-help-because-processing-can-t-read-slovak</link>
      <pubDate>Wed, 12 Jul 2017 14:13:29 +0000</pubDate>
      <dc:creator>lolnyancats</dc:creator>
      <guid isPermaLink="false">23416@/two/discussions</guid>
      <description><![CDATA[<pre><code>int currentSlide;
String[] slide;

String tl;
String tr;
String bl;
String br;

int time;
int wait=5000;

void setup(){
  size(800,1000);
  time=millis();
  currentSlide=0;
  slide=new String[500];
  slide=loadStrings("data for rosetta stone.txt"));
  tl=slide[0];
  tr=slide[2];
  bl=slide[1];
  br=slide[3];
}


void draw(){
  textSize(35);
  rectMode(CENTER);
  if(millis()-time&gt;=wait){
    time=millis();
    print("tick");
    tl=slide[currentSlide+4];
    tr=slide[currentSlide+6];
    bl=slide[currentSlide+3];
    br=slide[currentSlide+5];
  }
  background(255/2+50);
  fill(0);
  text(tl,50,50);
  text(tr,width/2+100,50);
  text(bl,50,height/2+50);
  text(br,width/2+50,height/2+50);
}
</code></pre>

<p>data in the text file</p>

<p>Ahoj</p>

<p>Hello</p>

<p>Zbohom</p>

<p>Goodbye</p>

<p>Ako sa máš</p>

<p>How are you</p>

<p>Ako sa voláš</p>

<p>What is your name</p>
]]></description>
   </item>
   <item>
      <title>text() - coordinates-reference-point and textSize() confusion</title>
      <link>https://forum.processing.org/two/discussion/23240/text-coordinates-reference-point-and-textsize-confusion</link>
      <pubDate>Wed, 28 Jun 2017 11:11:21 +0000</pubDate>
      <dc:creator>manuli</dc:creator>
      <guid isPermaLink="false">23240@/two/discussions</guid>
      <description><![CDATA[<p>Hello everyone,</p>

<p>having started with Processing recently I have the following confusion I have been struggling to explain to myself:</p>

<p>Assuming, that the coordinate reference point of (x, y) in text("text", x, y) is the bottom left corner of the "textbox", I thought that if the textSize exceeds the y-coordinate the text would be cropped on top, for example:</p>

<p><code>textSize(55);</code></p>

<p><code>text("Hello world", 50, 50);</code></p>

<p>For my understanding "Hello world" would have to be cropped on the top of the sketch-window as 50&lt;55. But - it is not. 
For <code>text("Hello world", 50, 40);</code>it touches the top boundary of the sketch-window.</p>

<p>Would anyone possibly mind to correct my misconception about the use of text() and textSize()?</p>

<p>Thank you so much in advance.</p>
]]></description>
   </item>
   <item>
      <title>How to display element# of ArrayList as text</title>
      <link>https://forum.processing.org/two/discussion/23044/how-to-display-element-of-arraylist-as-text</link>
      <pubDate>Tue, 13 Jun 2017 02:19:09 +0000</pubDate>
      <dc:creator>Nicho247</dc:creator>
      <guid isPermaLink="false">23044@/two/discussions</guid>
      <description><![CDATA[<p>Hello - 
New to processing. I have been following some YouTube tutorial videos by Daniel Shiffman @ Coding Train. I really liked his video on the Menger Sponge Fractal. I going to fold in some stuff about primes with his code from the video. Before I get there, I want to display the element# of an Array as text. Am a little confused with ArrayLists and can't get the syntax quite right. Any help would be great. To re-iterate, there is a 3d rotating series of boxes drawn, and they are all part of the ArrayList. I want to display with text, in each box the element position of that box in the box.</p>

<p>just showing the code on 1 of the two files (from Daniel Shiffman), as it is in the correct place (afaik)...</p>

<p>text('hi', 0,0,0); // this will have each 3-D box have 'hi' in the center. I don't know what to replace 'hi' with in order to display the element position of the ArrayList. The text function wants an int value in this position. Conflating this, the code is using push/pop which I am not too familiar with.</p>

<pre><code>class Box {
 PVector pos;
 float r;

 Box(float x, float y, float z, float r_) {
   pos = new PVector(x, y, z);
   r = r_;
 }

 ArrayList&lt;Box&gt; generate() {
  ArrayList&lt;Box&gt; boxes = new ArrayList&lt;Box&gt;();
  for (int x = -1; x &lt; 2; x++) {
    for (int y = -1; y &lt; 2; y++) {
      for (int z = -1; z &lt; 2; z++) {
        float newR = r/3;

        Box b = new Box(pos.x + x*newR,
                        pos.y + y*newR,
                        pos.z + z*newR,
                                  newR);
        int sum = abs(x) + abs(y) + abs(z);
          if (sum &gt; 1) {
            boxes.add(b);
          }
      }
    }
  }
  return boxes;
 }

 void show() {
  pushMatrix();
  translate(pos.x, pos.y, pos.z);
  text(sponge.Box, 0,0,0); // this is where I need help. sponge.Box is incorrect
  noStroke();
  fill(255, 100);
  box(r);
  popMatrix();
 }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>p5js text() and diacritics not showing up.</title>
      <link>https://forum.processing.org/two/discussion/22983/p5js-text-and-diacritics-not-showing-up</link>
      <pubDate>Thu, 08 Jun 2017 08:05:29 +0000</pubDate>
      <dc:creator>smanfly</dc:creator>
      <guid isPermaLink="false">22983@/two/discussions</guid>
      <description><![CDATA[<p>Hello
I have a problem with the text() in p5js.
I need it to show my diacritics characters:
example:" ș ă ț â ...";
But instead I get a square
I have added  and tried others, WTF-8, UTF-16... but nothing works.
My data it's in  a JSON file and i'm using the preload function with "var data = loadJSON('data.json')"
But even if I hardcode the text with a diacric character I have the same result.
I can't find relevant information on the web, or something that just works.</p>

<p>Thank you</p>
]]></description>
   </item>
   <item>
      <title>How to use text() for double</title>
      <link>https://forum.processing.org/two/discussion/22845/how-to-use-text-for-double</link>
      <pubDate>Wed, 31 May 2017 17:29:36 +0000</pubDate>
      <dc:creator>Devillord234</dc:creator>
      <guid isPermaLink="false">22845@/two/discussions</guid>
      <description><![CDATA[<p>Can I use text() to output a double variable? If not, what are some other ways to print it on my screen?</p>

<p>Thanks</p>
]]></description>
   </item>
   <item>
      <title>Strange behavoure with text(..)</title>
      <link>https://forum.processing.org/two/discussion/22289/strange-behavoure-with-text</link>
      <pubDate>Sat, 29 Apr 2017 17:48:39 +0000</pubDate>
      <dc:creator>dreezy</dc:creator>
      <guid isPermaLink="false">22289@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>i'm new here, but i cannot find the answer about my question.</p>

<p>I've writen a program with some text-entries.
The coordinates of the text are calculated by a for-loop</p>

<pre><code>for (i=0;i&lt;14;i++){
   StrStart=tijdStart[i].substring(0,IntstrTemp);  
     IntstrTemp=tijdStop[i].indexOf(":");
     StrStop=tijdStop[i].substring(0,IntstrTemp);
     text(StrStart+" t/m "+StrStop+" u",(i*85)+10,215+yTranspose);
     WeatherPicture = loadImage("http://" + "openweathermap.org/img/w/" + code[i] + ".png");
     image(WeatherPicture,(i*85)+10,210+yTranspose,60,60);
     text("vocht: "+vochtigheid[i]+"%",(i*85)+10,270+yTranspose);

etc
</code></pre>

<p>The first time the program runs, everything is at the right place, but after a minute, the program gets an update from openweathermap.org and prints the info again.</p>

<p>The info is now placed to the left.. Everything is out of order...</p>

<p>1st picture is the right alignment, second picture is after 1 minute....</p>

<p><img src="http://i1373.photobucket.com/albums/ag387/dreezy100/1_zpsp4cyvk7c.png" alt="" /></p>

<p><img src="http://i1373.photobucket.com/albums/ag387/dreezy100/2_zps7qfwqj7r.png" alt="" /></p>

<p>I hope you can give me some answer what to do.</p>

<p>Thanx</p>
]]></description>
   </item>
   <item>
      <title>how to make word in array shake when mouse is pressed?</title>
      <link>https://forum.processing.org/two/discussion/21970/how-to-make-word-in-array-shake-when-mouse-is-pressed</link>
      <pubDate>Thu, 13 Apr 2017 07:36:34 +0000</pubDate>
      <dc:creator>tor909</dc:creator>
      <guid isPermaLink="false">21970@/two/discussions</guid>
      <description><![CDATA[<p>hi guys, i am new a processing and I was wondering how do I get the word 'tickle' to move/shake when it appears on the screen?</p>

<p>Here is my code so far... thanks so much</p>

<pre><code>var img;
var antonyms = ["tickle", "angry", "raging", "fierce", "sad", "cross", "bitter","sulky"]



function preload(){
  img= loadImage ("tickle.jpeg");
  Indie= loadFont ("IndieFlower.ttf");
}


function setup() { 
  createCanvas(400, 400);
  noLoop();
  textFont (Indie, 48); 



}
function draw() { 
  background(255,255,255);
  image(img, 0,0,200,200);


var rnd_antonyms = random (antonyms);

text ("here", 220,100);
text ("comes", 200, 150);
text ("the", 230, 200);
text (rnd_antonyms, 220, 250);
text ("monster", 200, 300);



}
function keyPressed(){
  draw();
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>I need help making the numbers go into diferent rows instead of just one long row!</title>
      <link>https://forum.processing.org/two/discussion/21944/i-need-help-making-the-numbers-go-into-diferent-rows-instead-of-just-one-long-row</link>
      <pubDate>Tue, 11 Apr 2017 20:00:53 +0000</pubDate>
      <dc:creator>Sandyjakes</dc:creator>
      <guid isPermaLink="false">21944@/two/discussions</guid>
      <description><![CDATA[<p>I need help making the numbers go into diferent rows instead of just one long row!</p>

<pre><code>void setup() {

  size(1500, 600);
  background(0);

  for (int i = 0; i &lt;= 99; i ++) {
    textSize(9);
    text(i, i * 14.9 + 10, 100);

    if (i &lt; 99) {
      text(",", i * 14.95 + 18.5, 100);
    }
  }
  for (int j = 0; j &lt;= 9; j ++) {
    text("0", j * 15 + 5, 100);
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>blendMode() doesn't work with text</title>
      <link>https://forum.processing.org/two/discussion/21730/blendmode-doesn-t-work-with-text</link>
      <pubDate>Fri, 31 Mar 2017 13:44:15 +0000</pubDate>
      <dc:creator>Patakk</dc:creator>
      <guid isPermaLink="false">21730@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>In my program I want to use different blend modes when drawing text, but the text is not affected by the <em>blendMode()</em> function call.</p>

<p>Here's a simple program that demonstrates the issue, just move the mouse over the rectangle and see how the ellipse is correctly blended, as opposed to the letter 'K'.</p>

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

    rectMode(CENTER);
    textSize(100);
    textAlign(CENTER, CENTER);
}

void draw(){
    blendMode(NORMAL);
    background(50);

    noStroke();
    fill(255);
    rect(300, 300, 100, 100);

    blendMode(EXCLUSION);
    text("K", mouseX+50, mouseY);
    ellipse(mouseX-50, mouseY, 75, 75);
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to get on-canvas text to look smooth?</title>
      <link>https://forum.processing.org/two/discussion/14429/how-to-get-on-canvas-text-to-look-smooth</link>
      <pubDate>Wed, 13 Jan 2016 16:19:49 +0000</pubDate>
      <dc:creator>vwls</dc:creator>
      <guid isPermaLink="false">14429@/two/discussions</guid>
      <description><![CDATA[<p>I'm rendering text on a canvas (in this case in a chrome extension popup) and it looks really fuzzy. Anyone know how to render it so it looks as good as the off-canvas text?</p>

<p><img src="" alt="" /><img src="https://forum.processing.org/two/uploads/imageupload/018/3IU1F4IG2YIT.png" alt="Screen Shot 2016-01-13 at 11.17.26 AM" title="Screen Shot 2016-01-13 at 11.17.26 AM" /></p>
]]></description>
   </item>
   <item>
      <title>How to keep a moving obj in the center of the screen</title>
      <link>https://forum.processing.org/two/discussion/21047/how-to-keep-a-moving-obj-in-the-center-of-the-screen</link>
      <pubDate>Tue, 28 Feb 2017 07:19:27 +0000</pubDate>
      <dc:creator>ziphead2</dc:creator>
      <guid isPermaLink="false">21047@/two/discussions</guid>
      <description><![CDATA[<p>Hello. I've got two objects here : Red prototype "square" and its child green "zz". What I want is to click on the object and focus the screen on it. Make it stuck to it even when it moves. I can manage the clicking function but need a hint for the centering concept here.</p>

<pre><code>    var angle;


    var Polygon= function(x, y, hi, wei) {
        this.x = x;
        this.y = y;
        this.height = hi;
        this.width = wei;
    }
      Polygon.prototype.display = function() {
          push();
          translate(this.x, this.y);

          rect(0, 0,this.height, this.width);
          pop();
      }

      Polygon.prototype.area = function () {
        return this.calcArea();
      }

      Polygon.prototype.calcArea = function () {
        return this.height * this.width;
      }

    function Protogon(x, y, hi, wei, word) {
      Polygon.call(this, x, y, hi, wei);
      this.word = word;

    };

    Protogon.prototype= Object.create(Polygon.prototype); 
    Protogon.prototype.constructor = Protogon;
    Protogon.prototype.display = function() {
          push();
          translate(this.x, this.y);
          rotate(angle);
          rect(50, 0,this.height, this.width);
          text(this.word, 50, -10);
          pop();
    }

    function setup() {
      createCanvas(720, 400);
      angle = 1.0;
      square = new Polygon(width/2, height/2, 20, 40);
      zz = new Protogon(square.x+20, square.y+20, 60, 40, "Hello");
    }

    function draw() {
      background(50, 89, 100);
      stroke(1);
      fill('red'); 
      square.display();
      fill('green');
      zz.display();
      angle+=0.01 ;
    }
</code></pre>
]]></description>
   </item>
   <item>
      <title>Scrolling results from JSON</title>
      <link>https://forum.processing.org/two/discussion/20765/scrolling-results-from-json</link>
      <pubDate>Sun, 12 Feb 2017 21:55:13 +0000</pubDate>
      <dc:creator>leevanchief</dc:creator>
      <guid isPermaLink="false">20765@/two/discussions</guid>
      <description><![CDATA[<p>I am trying to make a list of football results stored in a JSON file scroll across the screen from left to right. I have tried so many ways but i cannot achieve this. Looking at my code i think that it doesn't scroll because txtX resets to 0 each run through draw. But, whatever way i change this it doesn't achieve the desired results... Here is my code:</p>

<pre><code>var scores;


function preload() {

scores = loadJSON("stats.json");

}

function setup() {

createCanvas(1400, 700);



}

function draw() {

background(254);

var txtX = 0;

var txtY = 550;

var stats = scores.results;

for (var i = 0; i &lt; stats.length; i++) {

textSize(12);

text(stats[i], txtX, txtY);

var wordWidth = textWidth(stats[i]);

var currentOffset = 15;

var currentwordX = wordWidth + currentOffset;   

txtX = txtX + currentwordX;


}                                                                

txtX = txtX - 1;

print(txtX);


}
</code></pre>

<p>//Here is my JSON</p>

<p>{
     "description" : "FA Cup results; 7th January 2017.",
     "source" : "<a href="http://www.bbc.co.uk/sport/football/results" target="_blank" rel="nofollow">http://www.bbc.co.uk/sport/football/results</a>",
     "results":[
      "Manchester United 4-0 Reading",
      "Accrington Stanley 2-1 Luton Town",
      "Barrow 0-2 Rochdale",
      "Birmingham City 1-1 Newcastle United",
      "Blackpool 0-0 Barnsley",
      "Bolton Wanderers 0-0 Crystal Palace",
      "Brentford 5-1 Eastleigh",
      "Brighton &amp; Hove Albion 2-0 Milton Keynes Dons",
      "Bristol City 0-0 Fleetwood Town",
      "Everton 1-2 Leicester City",
      "Huddersfiled Town 4-0 Port Vale",
      "Hull City 2-0 Swansea City",
      "Ipswich Town 2-2 Lincoln City",
      "Millwall 3-0 Bournemouth",
      "Norwich City 2-2 Southampton",
      "Queens Park Rangers 1-2 Blackburn Rovers",
      "Rotherham United 2-3 Oxford United",
      "Stoke City 0-2 Wolverhampton Wanderers",
      "Sunderland 0-0 Burnley",
      "Sutton United 0-0 AFC Wimbledon",
      "Watford 2-0 Burton Albion",
      "West Bromwich Albion 1-2 Derby County",
      "Wigan Athletic 2-0 Nottingham Forest",
      "Wycombe Wanderers 2-1 Stourbridge",
      "Preston North End 1-2 Arsenal"
      ]
      }</p>
]]></description>
   </item>
   <item>
      <title>How to outline text?</title>
      <link>https://forum.processing.org/two/discussion/16700/how-to-outline-text</link>
      <pubDate>Thu, 19 May 2016 14:13:40 +0000</pubDate>
      <dc:creator>damned</dc:creator>
      <guid isPermaLink="false">16700@/two/discussions</guid>
      <description><![CDATA[<p>I read reference and the forum but couldn't manage to outline a text in Processing 3.1.1.</p>

<p>For example take:</p>

<p><code>void setup(){
  size(800,800);
}
void draw(){
  stroke(360);
  strokeWeight(1);
  fill(0);
  textSize(30);
  text("test",200,200);
}</code></p>

<p>won't return an outlined text. How can I achieve that?
Thanks in advance for hints or answers.</p>
]]></description>
   </item>
   <item>
      <title>Retina - Text spacing</title>
      <link>https://forum.processing.org/two/discussion/19874/retina-text-spacing</link>
      <pubDate>Wed, 21 Dec 2016 19:34:11 +0000</pubDate>
      <dc:creator>ioeb</dc:creator>
      <guid isPermaLink="false">19874@/two/discussions</guid>
      <description><![CDATA[<p>the spacing differs when using "text" in retina or regular</p>

<p>pixelDensity(1);</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/495/MD2UWU1YVDCS.png" alt="Screenshot 2016-12-21 20.27.56" title="Screenshot 2016-12-21 20.27.56" /></p>

<p>pixelDensity(2);</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/583/GQQ574HPUKQU.png" alt="Screenshot 2016-12-21 20.28.22" title="Screenshot 2016-12-21 20.28.22" /></p>

<p>on MacBook Pro</p>

<p>Am I using text in a wrong way?</p>
]]></description>
   </item>
   <item>
      <title>Compiles and Displays really slowly, How do I make it faster?</title>
      <link>https://forum.processing.org/two/discussion/19820/compiles-and-displays-really-slowly-how-do-i-make-it-faster</link>
      <pubDate>Mon, 19 Dec 2016 07:00:30 +0000</pubDate>
      <dc:creator>IdemoniVezulu</dc:creator>
      <guid isPermaLink="false">19820@/two/discussions</guid>
      <description><![CDATA[<p>So I'm pretty new to Processing and for my latest "venture" of sorts I need to display a simple text. I created a global PFont and in the setup I created my font as Arial, with 12 points. Then when I displayed my text in that function I use the font in, I called the font to use and then the colour for it and finally the text. But this code is taking too long to compile and it stops responding once I start it. Is there a better way to do it so that it's faster? And, if it helps, I'm very familiar with C++, so if I could do it in ways similar to that it is not a problem.</p>
]]></description>
   </item>
   </channel>
</rss>