FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   How to enable [b][\b] "cheat code" ?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: How to enable [b][\b] "cheat code" ?  (Read 271 times)
dkor


How to enable [b][\b] "cheat code" ?
« on: Mar 30th, 2004, 6:36am »

I need to use a getGraphics but it seems to require weird [\b] "escape symbols". I stumbled upon these "escape symbols, when searching for getGraphics, I found some code by amoeba,  Koenie & Martin that use it.  
 
But when I use :
 
hiddenBuffer = Buffer.[b]getGraphics
()
 
in processing68 I get an "unexpected token error".
 
Tried to find an option to enable the [b][\b] "cheat code"
in pde.properties but I was unsuccessful.
 
In brief, any ideas an how to use the [b] [\b] secret code ?
 
By the way I want to create the Hidden buffer to use the Intersection method of a java.awt.Rectangle object. I want to find out the rectangle created when two intersecting rect objects. If you have an easier way of doing it that doesn't involve hardcore computational geometry I would love the suggestion.
 
  This is my first post, hope I'm not offtopic.
 
     Proce55ing is just beautiful beyond words.
 
        Daniel.
 
dkor


Re: How to enable [b][\b] "cheat code" ?
« Reply #1 on: Mar 30th, 2004, 6:41am »

Please don't waste time repliying this mail, just realized how stupid I am, after I saw the bold letters in my post.
 
 
dkor


Re: How to enable [b][\b] "cheat code" ?
« Reply #2 on: Mar 30th, 2004, 7:27am »

I feel compelled to apologize to the forum. My post was really unnecessary and I hate to waste other peoples times. I reallized that I was asking a question about YaBB Bulletin Board Code (YaBBC), and I am sorry.
[dkor ends his guilt trip]
 
Anyway, if anyone else cares about finding intersections using AWT Shapes as hidden objects in a hidden buffer here is an example :
 
Code:

BufferedImage Buffer;
Graphics gBuffer;
Rectangle r1, r2, r3;
boolean collide;
void setup()
{
  size (1024, 768);
  // create buffer
  BufferedImage Buffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  gBuffer = Buffer.getGraphics();
  //create 3 rectangle objects in the Buffer
  r1=new Rectangle(300,200,80,150);
  //we don't know the coordinates yet, so we create it
  //with a different constructor, passing only the size
  r2=new Rectangle(50,50);
  //of r3 we don't know anything yet, so we call the empty constructor
  r3=new Rectangle();
}
 
void loop() {
 
  background(51);
 
  //Move rectangle in the Buffer
  r2.move(mouseX, mouseY);
  //Move rectangle in processing
  rect(mouseX, mouseY, 50, 50);
  // create the static rectangle in proce55ing
  rect(300, 200, 80, 150);
  // check for collision
  collide=r1.intersects(r2);
  // show collision
  if(collide) {
    println("Intersection!");
    r3=r1.intersection(r2);
    fill(204, 102, 0);
    rect(r3.x, r3.y, r3.width, r3.height);
    fill(255);
  }
}
 
Pages: 1 

« Previous topic | Next topic »