# Fuzziness when switching sketches

**URL:** <https://discourse.processing.org/t/fuzziness-when-switching-sketches/6717>\
**Category:** Libraries\
**Created:** [December 17, 2018, 11:10pm UTC](https://discourse.processing.org/t/fuzziness-when-switching-sketches/6717 "2018-12-17T23:10:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zuii](https://avatars.discourse-cdn.com/v4/letter/z/51bf81/32.png) [@Zuii](https://discourse.processing.org/u/Zuii)\
**Post date:** [December 17, 2018, 11:10pm UTC](https://discourse.processing.org/t/fuzziness-when-switching-sketches/6717/1 "2018-12-17T23:10:34Z")

</div>

Hello,

I working on a kind of master sketch that can switch between sketches easily. The functionality is working great but for some reason when I switch to a different sketch it gets kinda fuzzy.

My program is setup like this:

```auto

var sketchArray = Object.kets(sketches);
var currentSketch = sketchArray[0];

function setup (){
  createCanvas()
}

function draw(){
  sketches[currentSketch].drawThis()
}

function switchSketch(){
  var nextPos = sketchArray.indexOf(currentSketch) + 1;
  if (nextPos < sketchArray.length){
    currentSketch = sketchArray[nextPos];
  } else {
    currentSketch = sketchArray[0];
  }
  sketches[currentSketch].setup();
}

var sketches = {
  sketch1: function(){
    function setupThis(){
      //some setup stuff
    }
    function drawThis(){
      // some draw stuff
    }
    return {
      setupThis: setupThis,
      drawThis: drawThis
    }
  }(),
  sketch2: // and so on
}

```

You can see what I mean by going here [http://172.104.16.113/](http://172.104.16.113/) . Pressing space will cycle through the sketches I have (don’t mind the picture that flashes at the beginning) and if you can back to the one you started at it will be fuzzy!

I appreciate any help I can get. Thank you in advance!!

-Zuii

---

<div class="post-metadata">

**Author:** ![figraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/figraham/32/4161_2.png) [@figraham](https://discourse.processing.org/u/figraham)\
**Post date:** [December 18, 2018, 1:10am UTC](https://discourse.processing.org/t/fuzziness-when-switching-sketches/6717/2 "2018-12-18T01:10:31Z")

</div>

Honestly kinda hard to tell without all the code but I’m guessing you just forgot to set the stroke weight and color in the first sketch because it resembles the stroke from the last one in the sequence.

---

<div class="post-metadata">

**Author:** ![Zuii](https://avatars.discourse-cdn.com/v4/letter/z/51bf81/32.png) [@Zuii](https://discourse.processing.org/u/Zuii)\
**Post date:** [December 18, 2018, 3:17am UTC](https://discourse.processing.org/t/fuzziness-when-switching-sketches/6717/3 "2018-12-18T03:17:59Z")

</div>

Omg that totally fixed it! It’s so easy to overlook simple solutions haha. Thank you!
