Processing Shape Placement -


I'm new to processing and trying to figure out why this is happening under the draw (). On the basis that where I compose a rectangle, it does not reveal or appear. My goal is to get a dragable circle in front of the rectangle

  int x; Int y; Public Zero Setup () (Size (600, 600);} Public Zero Draw () {Background (255); // If Timeline () is given here, then Circle does not appear (); Time (); / If the timeline is given here, the circle appears behind the rectangle} Public Zero Chakra () {Oval (it x, height / 2, 10, 10);} Public Zero MouseDrag ged () {Translation (width / 2 , Height / 2); This.x = mouseX; This.y = mouseY;} Press Public Zero Mouse () {Translation (width / 2, height / 2); If (mouse you Height = 2 + 10 & amp; mcaia> height / 2 - 10) {this.x = mouseX;}} Public Zero Timeline () {translation (width / 2, height / 2); rectMode ( Rect (0, 0, 2, 20);}  

Your The problem is that you are translating (from timeline () pusMatrix () function without the use of popmatics () ), so call those After that everything is being affected, as long as draw () does not end there , where the matrix is ​​reset.

If you pay attention, according to the orders given in the brain, the board is actually appearing in the lower part of the screen, at half height (at maximum height of

< P>

So you just need to incubate your changes, such as:

  int x; Int y; Public Zero Setup () (Size (600, 600);} Public Zero Draw () {Background (255); Time (); Circle ();} Public Zero Cycle () {Egg (Zero / 2, 10, 10);} Public Zero MouseDrag ged () {Translation (width / 2, height / 2); This.x = mouseX; This.y = mouseY;} Press Public Zero Mouse () (Translate (width / 2, height / 2); if (mouse u and lt; height / 2 + 10 & mcaa> height / 2 - 10) {this.x = mouseX;}} public null Timeline () {// Matrix changes cover // push pop matrix push matrix (;); (width / 2, height / 2); rectMode (center); rect (0, 0, 2, 20); popMatrix ();}  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -