# Fixed size with scroll

**URL:** <https://discourse.processing.org/t/fixed-size-with-scroll/5947>\
**Category:** Coding Questions\
**Created:** [November 26, 2018, 10:45am UTC](https://discourse.processing.org/t/fixed-size-with-scroll/5947 "2018-11-26T10:45:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HelaRua](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@HelaRua](https://discourse.processing.org/u/HelaRua)\
**Post date:** [November 26, 2018, 10:45am UTC](https://discourse.processing.org/t/fixed-size-with-scroll/5947/1 "2018-11-26T10:45:37Z")

</div>

Hi 🙂

I’m very new to processing. —noob alert—  
For my college project I’m trying to create a background with a fixed size at first glance (2560x1600) but is in reality bigger than that (3840x3200), allowing you to scroll down & sideways by clicking and dragging your mouse.

I’ve looked for answers and I can’t really find anything that helps.  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [November 26, 2018, 12:40pm UTC](https://discourse.processing.org/t/fixed-size-with-scroll/5947/2 "2018-11-26T12:40:15Z")

</div>

Example:

```auto
float xos, yos;

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

void draw() {
  background(0);
  translate(-xos, -yos);
  fill(0, 200, 0);
  ellipse(200, 200, 100, 100);
  fill(0, 0, 200);
  ellipse(600, 600, 100, 100);
}

void mouseDragged() {
  xos += pmouseX - mouseX;
  yos += pmouseY - mouseY;
  xos = constrain(xos,0,400);
  yos = constrain(yos,0,400);
  
}

```

Good luck with your project.
