# Processing coding help - Sliders

**URL:** https://discourse.processing.org/t/processing-coding-help-sliders/24462
**Category:** Processing
**Tags:** homework
**Created:** [October 9, 2020, 11:56am UTC](https://discourse.processing.org/t/processing-coding-help-sliders/24462 "2020-10-09T11:56:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ellie98](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@Ellie98](https://discourse.processing.org/u/Ellie98)
#### Post date: [October 9, 2020, 11:56am UTC](https://discourse.processing.org/t/processing-coding-help-sliders/24462/1 "2020-10-09T11:56:34Z")

</div>

Hello, could someone look into my code? I don’t know how to continue.  
I had to code 4 Sliders. Two are following the Y-direction and two the X-direction. But one of the two sliders have to go to the opposide direction and I don’t know how to do that. Could someone help me out? I wrote a note the the slider that has to go to the opposide direction.Thanks in advance!

```auto
void setup() {
  surface.setTitle("MalKlein_MalGross");
  size(500, 500);
  surface.setLocation(250, 250); //Skizze zentriert am Bildschirm anzeigen

}
void draw() {
    background(255, 255, 255);
    stroke(0);
    
 //Seitenlinien mit 15 Abstand, parallel zu den Rändern
  strokeWeight(3);
  line(0, 15, 500, 15);
  strokeWeight(3);
  line(15, 0, 15, 500);
  strokeWeight(3);
  line(0, 485, 500, 485);
  strokeWeight(3);
  line(485, 0, 485, 500);

  //Beschriftungen werden angegeben & Schriftgrößen
  fill(0, 255, 0);
  textSize(12);
  text("Links", 20, 10);

  fill(0, 255, 0);
  textSize(12);
  text("Groß", 20, 30);

  fill(0, 255, 0);
  textSize(12);
  text("Rechts", 445, 10);

  fill(255, 0, 0);
  textSize(12);
  text("Groß", 455, 30);

  fill(0, 255, 0);
  textSize(12);
  text("Klein", 20, 480);

  fill(255, 0, 0);
  textSize(12);
  text("Links", 20, 497);

  fill(255, 0, 0);
  textSize(12);
  text("Klein", 455, 480);

  fill(255, 0, 0);
  textSize(12);
  text("Rechts", 445, 497);

//Alle 4 Slider kommen dazu **HERE ARE THE SLIDERS**
  fill(0, 255, 0);
  noStroke();
  square(12, mouseY, 6);
  
  //Hier entgegengesetzt **THIS ONE HAS TO GO TO THE OPPOSIDE DIRECTION OF THE ONE ABOVE**
    fill(255, 0, 0);
  noStroke();
  square(483, mouseY, 6);
  
    fill(255, 0, 0);
  noStroke();
  ellipse(mouseX, 485, 5,10);
  
  //Hier auch entgegengesetzt **THIS ONE HAS TO GO THE OPPSIDE DIRECTION OF THE ONE ABOVE**
   fill(0, 255, 0);
  noStroke();
  ellipse(mouseX, 16, 5,10); 
}

```

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [October 9, 2020, 12:33pm UTC](https://discourse.processing.org/t/processing-coding-help-sliders/24462/2 "2020-10-09T12:33:32Z")

</div>

Hello,

Please format your code:  
[https://processing.org/reference/map\_.html](https://processing.org/reference/map_.html)

`:)`

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [October 9, 2020, 12:48pm UTC](https://discourse.processing.org/t/processing-coding-help-sliders/24462/3 "2020-10-09T12:48:19Z")

</div>

If you want the direction to be inversed, then take `width - mouseX` and `height - mouseY`  
respectively

also only format the code please, otherwise we cant see your question

---

<div class="post-metadata">

### Author: ![Ellie98](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@Ellie98](https://discourse.processing.org/u/Ellie98)
#### Post date: [October 9, 2020, 12:54pm UTC](https://discourse.processing.org/t/processing-coding-help-sliders/24462/4 "2020-10-09T12:54:29Z")

</div>

Thank you so much! 😀
