# How to write my code so that it adjusts to mobile screen for p5.js?

**URL:** <https://discourse.processing.org/t/how-to-write-my-code-so-that-it-adjusts-to-mobile-screen-for-p5-js/24456>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [October 9, 2020, 5:29am UTC](https://discourse.processing.org/t/how-to-write-my-code-so-that-it-adjusts-to-mobile-screen-for-p5-js/24456 "2020-10-09T05:29:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam101](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sam101](https://discourse.processing.org/u/sam101)\
**Post date:** [October 9, 2020, 5:29am UTC](https://discourse.processing.org/t/how-to-write-my-code-so-that-it-adjusts-to-mobile-screen-for-p5-js/24456/1 "2020-10-09T05:29:19Z")

</div>

Hey everyone, I was just wondering if I have a code that when I upload it as a website it works on a desktop, but then how would I write it out so that it also adjusts to a mobile screen as well. The code is in p5.js and I uploaded it as a website through Github. When on a mobile screen, it doesn’t show the best results.

Any recommendations or resources would be great!

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [October 9, 2020, 7:02am UTC](https://discourse.processing.org/t/how-to-write-my-code-so-that-it-adjusts-to-mobile-screen-for-p5-js/24456/2 "2020-10-09T07:02:22Z")

</div>

Perhaps this discussion gives you an option how to solve your problem [Setting size of display window to a percentage of screen size](https://discourse.processing.org/t/setting-size-of-display-window-to-a-percentage-of-screen-size/22228)
