<?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 settitle() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=settitle%28%29</link>
      <pubDate>Sun, 08 Aug 2021 21:21:04 +0000</pubDate>
         <description>Tagged with settitle() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedsettitle%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>How to make rendering on screen faster?</title>
      <link>https://forum.processing.org/two/discussion/25020/how-to-make-rendering-on-screen-faster</link>
      <pubDate>Wed, 15 Nov 2017 08:40:48 +0000</pubDate>
      <dc:creator>mproc</dc:creator>
      <guid isPermaLink="false">25020@/two/discussions</guid>
      <description><![CDATA[<p>I am writing this program to plot graphs on screen. However, the rendering is too slow. Any clues how it can be made faster? Here is the code below. It plots a simple Archimedes spiral.</p>

<pre><code>float r=0,a=0,t=0,x0=0,y0=0,x=0,y=0;
int c=80;

void setup(){
  size(1024,768);
  background(0);
  strokeWeight(1);
  stroke(c,100,150);
}

void draw(){

  translate(width/2,height/2);

   if(t&lt;=30*PI)
    {
      x0=r*cos(a);
      y0=r*sin(a);

      a=t;//360*(sin(t/20)+0.5*sin(t/40));
      r=a;//200*(sin(t/40)+0.5*sin(t/80));

      x=r*cos(a);
      y=r*sin(a);

      line(x0,-y0,x,-y);

      t+=0.1;
   }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to go back to original colour using IF statements?</title>
      <link>https://forum.processing.org/two/discussion/24960/how-to-go-back-to-original-colour-using-if-statements</link>
      <pubDate>Sat, 11 Nov 2017 03:00:26 +0000</pubDate>
      <dc:creator>newcode123</dc:creator>
      <guid isPermaLink="false">24960@/two/discussions</guid>
      <description><![CDATA[<p>I want to be able to cycle my colours indefinitely on mouse clicks, and I know that if I have three colours in total, so colourOne=0, colourTwo=1, colourThree=2, then I will need to make it so when the mouse is clicked at colourThree, i'll get the value 0. but I am not sure how to put that in my code.</p>

<pre><code>boolean colourOne= false;
boolean colourTwo= false;
boolean colourThree= false;

void setup(){
  size(500,500);
}

void draw(){

  rect(100,100,50,50);
  allColours();
}

void colourRed(){
  background(255,0,0);
}

void colourGreen(){
  background(0,255,0);
}

void colourBlue(){
  background(0,0,255);
}
void allColours(){
  if(colourOne){
    colourRed();
    if(colourTwo){
      colourGreen();
      if(colourThree){
        colourBlue();

}
    }
  }
}

void mouseClicked(){
  if(!colourOne){
    colourOne=true;
  }
  else if(!colourTwo){
    colourTwo=true;
  }
  else if(!colourThree){
    colourThree=true;
  }
}
</code></pre>
]]></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>Create 10 instances of an object (Python)</title>
      <link>https://forum.processing.org/two/discussion/19200/create-10-instances-of-an-object-python</link>
      <pubDate>Mon, 21 Nov 2016 20:50:07 +0000</pubDate>
      <dc:creator>juicy</dc:creator>
      <guid isPermaLink="false">19200@/two/discussions</guid>
      <description><![CDATA[<p>Hello Forum,</p>

<p>I got a question:
First off: I'm using Python Mode.
I'm trying to instantiate an object 10 times, but whatever i do ends up in the ellipses getting a tremendous speed boost.
The idea is: Create 10 ellipses all spawning on different locations and with different velocity.
Is this possible using lists?
Here is the code, creating 1 instance of the object:</p>

<pre><code>from BallTab import Ball

def setup():
    global myFirstBall
    size(800, 800)
    myFirstBall = Ball(random(50, 750), random(50, 750), 2, 3, 100)


def draw():
    global myFirstBall
    background(69, 69, 69) 
    myFirstBall.display()
    myFirstBall.move()
    if myFirstBall.y &gt; 750:
        myFirstBall.ys = -2
    if myFirstBall.x &gt; 750:
        myFirstBall.xs = -3
    if myFirstBall.y &lt; 50:
        myFirstBall.ys = 2
    if myFirstBall.x &lt; 50:
        myFirstBall.xs = 3
</code></pre>

<p>BallTab:</p>

<pre><code>class Ball(object):
    def __init__(self, xPos, yPos, xSpeed, ySpeed, radius):
        self.x = xPos
        self.y = yPos
        self.xs = xSpeed
        self.ys = ySpeed
        self.r = radius

    def display(self):
        ellipse(self.x, self.y, self.r, self.r)

    def move(self):
        self.x += self.xs
        self.y += self.ys
</code></pre>
]]></description>
   </item>
   <item>
      <title>keyPressed and keyReleased functions NOT WORKING! Help!</title>
      <link>https://forum.processing.org/two/discussion/19339/keypressed-and-keyreleased-functions-not-working-help</link>
      <pubDate>Sun, 27 Nov 2016 21:57:09 +0000</pubDate>
      <dc:creator>MyName</dc:creator>
      <guid isPermaLink="false">19339@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I have been trying a ton of different approaches with keyPressed and keyReleased functions. One example is this:</p>

<pre><code>void power ()
{
  float time = 0;
 while(keyPressed)
 {
   if(key == ' ' &amp;&amp; power&lt;max_power)
    power +=.01; 
    delay(10);
    println(power);
 }
</code></pre>

<p>Here, ideally, every time I press the space bar, and the power is below a certain value, we increment the power.However, even when I RELEASE the space bar, power continues to be incremented until max_power. This doesn't make any sense to me because when any of the keys are NOT being pressed, the while is essentially like while(FALSE). So I don't see how it could continue to be incremented. Not sure if the problem lies in the fact that I put this function in void loop, but whats happening seems very counterintuitive.</p>

<p>I tried this other function as well to count the time, but this does not work either:</p>

<pre><code> float time = 0;
float final_time;
void setup ()
{

}
void loop ()
{
  println(time+"   "+final_time);

}
void keyPressed()
{
 time = millis(); 
}
void keyReleased()
{
  final_time = time;
  time = 0;
}
</code></pre>

<p>Or I've tried this as well to count the time:</p>

<pre><code>float time = 0;
void setup ()
{

}
void loop ()
{
if (keyPressed)
{
  delay(100);
  time+=.1;
}
println(time);
}
</code></pre>

<p>But this doesn't work either....</p>

<p>I'm sure there is something very simple behind my error.</p>

<p>Thank you!!!!</p>
]]></description>
   </item>
   <item>
      <title>Simple keyboard toggle switch?</title>
      <link>https://forum.processing.org/two/discussion/17930/simple-keyboard-toggle-switch</link>
      <pubDate>Sun, 21 Aug 2016 18:17:24 +0000</pubDate>
      <dc:creator>BurtonBenson</dc:creator>
      <guid isPermaLink="false">17930@/two/discussions</guid>
      <description><![CDATA[<p>Tổng hợp các kí tự đặc trưng LMHT.
Này mọi người! Làm như thế nào để có một cái tên “chất như nước cất” bên trong game? Tất cả là nhờ vào các kí tự đặc biệt LMHT. Bài viết này sẽ giúp mọi người hết từ A tới Z nhé!</p>

<p><a rel="nofollow" href="https://www.scoop.it/t/bang-chu-cai-ky-tu-dac-biet"><img src="https://i.imgur.com/o2yEuQr.jpg" alt="" /></a></p>

<p>các anh em có khi nào thấy nhàm chán vì đánh LOL mấy năm rồi nhìn tên gọi cũ xì của bản thân mình chưa? Hay là do bạn với 1 tên gọi quá nhố nhăng nên về sau càng lên level các bạn mong muốn đổi một tên gọi thế nào cho ý nghĩa hơn! Để chuẩn bị sẵn sàng cho mùa giải mới năm 2018, tụi mình sẽ tuyển tập cho bạn những kí tự đặc trưng LMHT. Trong khoảng thời gian cách đây không lâu, e-sport nước ta chuyển biến khá nhiều và liên tục có được các vị trí quan trọng đặc biệt là bên trong trò LMHT. Để đổi tên nick bên trong LMHT trước hết mọi người phải sắm thẻ đổi tên gọi, trị giá thẻ đổi tên ngày nay khoảng 300rp, tức là tầm 80k tiền mặt. Đặc biệt các người chơi mới của LOL, khi vào trận cùng mọi người và đối thủ bạn sẽ hết sức ấn tượng với những tên gọi độc đáo được tạo với những kí tự, những icon, bình luận chưa từng thấy. Sẽ có rất nhiều những kí tự có thể các bạn không biết, hy vọng chia sẻ này sẽ giúp cho mọi người có thêm thông tin về LMHT. Cái tên làm nên tính cách! Vậy làm thế nào để làm được như họ? Cứ yên tâm có chúng mình với các kí tự đặc trưng LMHT sẽ giúp cho mọi người tự tin khoe tính cách. Xem thêm các kí tự đặc biệt trong au mobile tại: <a rel="nofollow" href="https://medium.com/ki-tu-dac-biet/ki-tu-dac-biet-trong-au-mobile-66e9c48f5ddd">https://medium.com/ki-tu-dac-biet/ki-tu-dac-biet-trong-au-mobile-66e9c48f5ddd</a></p>

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

<p>Những kí tự đặc biệt LMHT có vẻ đơn thuần nhưng đó chính là công sức của một hàng ngũ chế tạo game, tâm huyết của các người làm game dành tặng cho chúng ta. Ngày nay càng nhiều những cái tên mới bên trong làng eSports xuất hiện kể cả những tên gọi game offline giống như  Call of Duty WWII, Super Mario Odyssey … và game đang hot Getting Over it cũng chẳng thể nào quật ngã được ông trùm LMHT. Hiện tại LMHT không đơn thuần là một trò chơi điện tử bình thường mà đích thực ông lớn này đã thành 1 bộ môn thể thảo được đam mê hàng đầu ở trên thế giới.</p>

<p><img src="https://i.imgur.com/7A2Qoe0.png" alt="" /></p>

<p>Vài năm mới đây đấu trường Việt Nam đang tấp nập hơn nhiều khi mà nước ta với đội tuyển Young Generation được tham gia giải đấu LMHT lớn nhất thế giới. Bạn thấy ko hãy thực hiện những gì mà bản thân yêu thích thành một game thủ lý tưởng lúc bạn mang tài năng thực thụ.Với một tên gọi có những kí tự đặc trưng chất đến phát ngất giống như thế cùng với 1 metagame đúng đắn bản thân mình tin rằng các anh em sẽ chiến đấu một cách mạnh mẽ và kiên cường hơn bao giờ hết. Nào hãy sử dụng liền những kí tự đặc trưng LMHT nhé!
Tìm hiêut thêm "các kí tự đặc biệt" tại: <a rel="nofollow" href="https://medium.com/ki-tu-dac-biet">https://medium.com/ki-tu-dac-biet</a></p>
]]></description>
   </item>
   <item>
      <title>Two windows in Eclipse</title>
      <link>https://forum.processing.org/two/discussion/17498/two-windows-in-eclipse</link>
      <pubDate>Tue, 12 Jul 2016 14:33:06 +0000</pubDate>
      <dc:creator>CharlesDesign</dc:creator>
      <guid isPermaLink="false">17498@/two/discussions</guid>
      <description><![CDATA[<p>Hi there,</p>

<p>Following the "frame" example from the CP5 library I tried to implement two windows in my Eclipse project.
I've managed to get it running but three out of four times I get the following error message  which I believe is being caused by this line but I may be wrong.</p>

<pre><code>p.runSketch(new String[] { this.getClass().getName() }, this);
</code></pre>

<p>It also gives me this message but I doubt it has anything to do with the error.</p>

<blockquote class="Quote">
  <p>The static method runSketch(String[], PApplet) from the type PApplet should be accessed in a static way</p>
</blockquote>

<p>Thanks in advance :)
Charles</p>

<p>Ps: The sketch runs fine in processing just not in Eclipse</p>

<pre><code>import peasy.PeasyCam;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PImage;

public class MAIN extends PApplet {

  PeasyCam cam;
  ControlFrame cf;

  public static void main(String[] args) {
    PApplet.main("MAIN");
  }

  public void settings() {
    size((int) (1366 * 0.7f), 730, P3D);
  }

  public void setup() {
    colorMode(PConstants.HSB);
    surface.setLocation((int) (1366 * 0.3), 0);
    cf = new ControlFrame(this, (int) (1366 * 0.3), 730, "Controls");
  }

  public void draw() {

    background(Ui.gradient);
    surface.setTitle(nf(frameRate, 2, 2) + " .fps");
  }
}

import controlP5.ControlP5;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PImage;

class ControlFrame extends PApplet {

  int w, h;
  PApplet p;
  static ControlP5 cp5;

  public ControlFrame(PApplet _p, int _w, int _h, String _name) {
    super();
    p = _p;
    w = _w;
    h = _h;
    p.runSketch(new String[] { this.getClass().getName() }, this);
  }

  public void settings() {
    size(w, h);
  }

  public void setup() {
    surface.setLocation(0, 0);
    surface.setTitle("PHEET - Controls | V3.0");
    frameRate(50);
    colorMode(HSB);

    cp5.addToggle("orth").setPosition((int) (width * 0.01), (int) (height * 0.2)).setSize(50, 15).setValue(true)
      .setMode(ControlP5.SWITCH).plugTo(p, "orth");
    ;
  }

  public void draw() {
    background(245);
  }
}

 RunnableTask.run(): A caught exception occured on thread main-Display-.macosx_nil-1-EDT-1: RunnableTask[enqueued true[executed false, flushed false], tTotal 0 ms, tExec 0 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;]
 java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;
 at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
 at jogamp.newt.WindowImpl$SetPositionAction.run(WindowImpl.java:2884)
 at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:450)
 at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2782)
 at jogamp.newt.WindowImpl.setPosition(WindowImpl.java:2911)
 at jogamp.newt.WindowImpl.setTopLevelPosition(WindowImpl.java:2917)
 at com.jogamp.newt.opengl.GLWindow.setTopLevelPosition(GLWindow.java:514)
 at processing.opengl.PSurfaceJOGL$7.run(PSurfaceJOGL.java:767)
 at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127)
 at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)
 DefaultEDT.run(): Caught exception occured on thread main-Display-.macosx_nil-1-EDT-1: RunnableTask[enqueued false[executed true, flushed false], tTotal 5002 ms, tExec 5002 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;]
 java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;
 at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
 at jogamp.newt.WindowImpl$SetPositionAction.run(WindowImpl.java:2884)
 at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:450)
 at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2782)
 at jogamp.newt.WindowImpl.setPosition(WindowImpl.java:2911)
 at jogamp.newt.WindowImpl.setTopLevelPosition(WindowImpl.java:2917)
 at com.jogamp.newt.opengl.GLWindow.setTopLevelPosition(GLWindow.java:514)
 at processing.opengl.PSurfaceJOGL$7.run(PSurfaceJOGL.java:767)
 at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127)
 at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to make a keyPressed into a toggle?</title>
      <link>https://forum.processing.org/two/discussion/17403/how-to-make-a-keypressed-into-a-toggle</link>
      <pubDate>Sun, 03 Jul 2016 17:51:37 +0000</pubDate>
      <dc:creator>koko</dc:creator>
      <guid isPermaLink="false">17403@/two/discussions</guid>
      <description><![CDATA[<p>Hello world.</p>

<p>I'm currently using this code to flicker through a folder of imagery in my data folder.</p>

<pre><code>//declare and initialise variables
static final int BACKS = 4;
final PImage[] bgs = new PImage[BACKS];


void setup () {
  size (1920, 1080);
  frameRate (6); //Rate of flickering
    smooth (4);

  //load my imagery
      for (int i = 0; i &lt; BACKS; bgs[i] = loadImage("bg" + i++ + ".jpg")); 

    }

void draw () { 

      image(bgs[int(random(0, BACKS))], 0, 0, width, height);//Set a random Image - the size of the sketch
        if ((keyPressed == true) &amp;&amp; (keyCode == UP)) { //THIS IS WHAT STOPS THE LOOP
        noLoop ();

    }
  }
</code></pre>

<p>When i press the UP key the looping stops, but is there a way i can press the UP key again for it to begin looping again?</p>

<p>Any help would be great!</p>

<p>Thanks - KOKO.</p>
]]></description>
   </item>
   <item>
      <title>Waiting until a condition is true</title>
      <link>https://forum.processing.org/two/discussion/16450/waiting-until-a-condition-is-true</link>
      <pubDate>Fri, 06 May 2016 00:19:53 +0000</pubDate>
      <dc:creator>ailurophile</dc:creator>
      <guid isPermaLink="false">16450@/two/discussions</guid>
      <description><![CDATA[<p>I’m trying to make a function that will pause the program until a condition is true. Here’s what I thought would work:</p>

<pre><code>def wait_until( x ):
    while not x():
        pass
</code></pre>

<p>I’ve tried it with something like <code>wait_until( lambda: keyPressed )</code> or <code>wait_until( lambda: mouseX &gt; 250 )</code> but neither of those works — the functions I input never seem to return <code>True</code>. Can you help me figure out why?</p>

<p>I don’t think it’s a problem with <code>wait_until</code> — I’ve found that it doesn’t work even if I just say something like this:</p>

<pre><code>def setup():
    size( 200, 200 )
    while not keyPressed:
        pass
    background( 255 )
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to make the webcam capture window go away or put images over it</title>
      <link>https://forum.processing.org/two/discussion/16435/how-to-make-the-webcam-capture-window-go-away-or-put-images-over-it</link>
      <pubDate>Thu, 05 May 2016 09:26:15 +0000</pubDate>
      <dc:creator>Clova</dc:creator>
      <guid isPermaLink="false">16435@/two/discussions</guid>
      <description><![CDATA[<p>I'm using a webcam for the beginning of my project, but after a while I want to clear the screen and start a whole new page. I can probably do this by covering up the screen with a big white rectangle, however, nothing will cover up the webcam window. The camera part of my code looks like this:</p>

<p>String[] cameras = Capture.list();
cam = new Capture(this, cameras[000]);
    cam.start();</p>

<p>and then</p>

<p>void draw() {
  if (cam.available() == true) {
    cam.read();
  }</p>

<p>Since it says if(cam.available() == true), I tried to set cam.available to false, but even that wouldn't work, giving the error, "the field capture.available is not visible." 
I'm very desperate.</p>

<p>As an alternative, does anyone know a way to make different pages, so when you click a button, it takes everything you've already done away completely? I've looked into it a lot, and found people saying setting the background(255) at the beggining of draw, or doing multiple draws, but I couldn't get it to work. I also tried the redraw() and clear() functions without any success.</p>

<p>PLEASE help</p>
]]></description>
   </item>
   <item>
      <title>mapping event (modifying x and y)</title>
      <link>https://forum.processing.org/two/discussion/13573/mapping-event-modifying-x-and-y</link>
      <pubDate>Fri, 20 Nov 2015 03:03:29 +0000</pubDate>
      <dc:creator>gperez</dc:creator>
      <guid isPermaLink="false">13573@/two/discussions</guid>
      <description><![CDATA[<p>Hi. 
I'm working on a "control window", meaning a secondary window that can control the primary one. 
In that control window I have a little representation of the main window. And i wish i could click on that little section and map mouseEvents to primary window. Issue is that mouseEvent class has no public method to modify x and y values. 
Is there any java trick I could implement?
Thanks in advance.</p>
]]></description>
   </item>
   <item>
      <title>Frame settings</title>
      <link>https://forum.processing.org/two/discussion/11991/frame-settings</link>
      <pubDate>Thu, 06 Aug 2015 19:57:22 +0000</pubDate>
      <dc:creator>snkemp</dc:creator>
      <guid isPermaLink="false">11991@/two/discussions</guid>
      <description><![CDATA[<p>Hello all,</p>

<p>I was wondering how to alter the frame that is automatically made with a processing app. 
I know you can call frame.setTitle("Helloworld"); however I was hoping to so more advanced stuff such as add a JMenuBar or change the look and feel or even change the icon.</p>
]]></description>
   </item>
   <item>
      <title>How can I show a text with toggle button g4p</title>
      <link>https://forum.processing.org/two/discussion/11951/how-can-i-show-a-text-with-toggle-button-g4p</link>
      <pubDate>Mon, 03 Aug 2015 15:39:16 +0000</pubDate>
      <dc:creator>Mino32</dc:creator>
      <guid isPermaLink="false">11951@/two/discussions</guid>
      <description><![CDATA[<p>Hi!</p>

<p>I'm trying to use g4p controls and now I'm proving toggle image button. The problem is that I want to show one message when the button is "on" (all the time), and I can't, it shows the message only when it changes its state and then the message disappear even if the button is still "on". This is the code that I'm using:</p>

<pre><code>import g4p_controls.*;

GImageToggleButton tag_OnOff;

public void setup() {
  size(480, 220, JAVA2D);
  G4P.setGlobalColorScheme(GCScheme.ORANGE_SCHEME);
  G4P.setCursor(ARROW);
  if (frame != null)
    frame.setTitle("Sketch Window");
  // Create image toggle buttons
  tag_OnOff  = new GImageToggleButton(this, 10, 90, "o_of.png", 2, 1);
}

public void handleToggleButtonEvents(GImageToggleButton button, GEvent event) { 
  fill(0);
  if(tag_OnOff.getState()==1)
  {
    text("On",10,10);
  }


}

public void draw() {
  background(180);
}
</code></pre>

<p>Can you help me please??</p>
]]></description>
   </item>
   <item>
      <title>Increase size in time</title>
      <link>https://forum.processing.org/two/discussion/10286/increase-size-in-time</link>
      <pubDate>Sun, 12 Apr 2015 15:59:42 +0000</pubDate>
      <dc:creator>moonpalace</dc:creator>
      <guid isPermaLink="false">10286@/two/discussions</guid>
      <description><![CDATA[<p>Hello folks, 
I'm working on a very basic thing: I'd like to increase the size of an ellipse from a very tiny point to fill all the display window. This should happen in 20 minutes. The code I've attached below it works but so far I control the increase with the value of the variable rMove1 and I'd like to do it using something with time, since It should happen in 20 minutes exactly. 
I'm a newbie and I'm pretty sure there's an easy way to do it. 
Thank you in advance!</p>

<pre><code>float radius1 = 1;
float rMove1 = 0.001;
int xPos1 = 200;
int yPos1 = 200;

void setup()
{
size(400, 400);
frameRate(30);
}
void draw()
{
 background(0);
 fill(255);
 noStroke();
 ellipse(xPos1, yPos1, radius1, radius1);
 radius1 += rMove1;
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>frame.setIconImage()</title>
      <link>https://forum.processing.org/two/discussion/7337/frame-seticonimage</link>
      <pubDate>Thu, 25 Sep 2014 06:51:15 +0000</pubDate>
      <dc:creator>colouredmirrorball</dc:creator>
      <guid isPermaLink="false">7337@/two/discussions</guid>
      <description><![CDATA[<p>I was curious as to how to change the frame icon of an applet upon runtime. I couldn't find an example of how to do it in Processing, so here is an example sketch.</p>

<pre><code>PGraphics pg;    

color background = 0;
color foreground = color(255);


void setup()
{
  size(300, 300);
  pg = createGraphics(width, height);

}

void draw()
{
  background(0);
  frame.setTitle("Framerate: " + frameRate);    //I can't code... getting 5-15 fps on my system...
  float fC = (float) frameCount;
  background = color( 255* (sin( fC*0.01)*0.5+0.5), 255* (sin( fC*0.01 + TWO_PI*0.3333)*0.5+0.5), 255* (sin( fC*0.01 + TWO_PI*0.6666)*0.5+0.5));
  foreground = color( 255-255* (sin( fC*0.01)*0.5+0.5), 255-255* (sin( fC*0.01 + TWO_PI*0.3333)*0.5+0.5), 255-255* (sin( fC*0.01 + TWO_PI*0.6666)*0.5+0.5));

  //Creating some pixels:
  pg.loadPixels();
  for (int i = 0; i &lt; pg.width; i++)
  {
    for (int j = 0; j &lt; pg.height; j++)
    {
      int dist = (int) (pow(i-mouseX, 2) + pow(j-mouseY, 2));
      //Abuse negative colour values:
      color colour = color(((background &gt;&gt; 16) &amp; 0xFF)-((foreground&gt;&gt;16)&amp;0xFF)*dist*0.01*(sin(dist*0.01+frameCount*0.01)*0.5+0.5), 
      ((background &gt;&gt; 8) &amp; 0xFF)-((foreground&gt;&gt;8)&amp;0xFF)*dist*0.01*(sin(dist*0.01+TWO_PI*0.3333+frameCount*0.01)*0.5+0.5), 
      (background  &amp; 0xFF)-((foreground)&amp;0xFF)*dist*0.01*(sin(dist*0.01+TWO_PI*0.6666+frameCount*0.01)*0.5+0.5));
      pg.pixels[i+width*j] = colour;    //set the pixels for the PGraphics

    }
  }
  pg.updatePixels();

  image(pg, 0, 0);    //Render the PGraphics to the PApplet
  frame.setIconImage(pg.image);    //Render the PGraphics to the Windows icon, PGraphics.image is a java.awt.Image field which is what the setIconImage method needs.
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>void</title>
      <link>https://forum.processing.org/two/discussion/7330/void</link>
      <pubDate>Wed, 24 Sep 2014 14:49:33 +0000</pubDate>
      <dc:creator>DzAnej</dc:creator>
      <guid isPermaLink="false">7330@/two/discussions</guid>
      <description><![CDATA[<p>Is it possible to have another void that is looping as void draw() ?</p>
]]></description>
   </item>
   </channel>
</rss>