# \[SOLVED\] Fullscreen sketch scaling and preformance

**URL:** <https://discourse.processing.org/t/solved-fullscreen-sketch-scaling-and-preformance/3916>\
**Category:** Coding Questions\
**Created:** [September 27, 2018, 6:45pm UTC](https://discourse.processing.org/t/solved-fullscreen-sketch-scaling-and-preformance/3916 "2018-09-27T18:45:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Sarah](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sarah/32/1675_2.png) [@Sarah](https://discourse.processing.org/u/Sarah)\
**Post date:** [September 28, 2018, 11:15am UTC](https://discourse.processing.org/t/solved-fullscreen-sketch-scaling-and-preformance/3916/4 "2018-09-28T11:15:12Z")

</div>

Do you want the sketch to expand itself to fullscreen, but keep its original aspect ratio, or for it to simply keep its size with any screen?

If you want the prior option, you can just put:

```auto
if (width > height) pg=createGraphics(height, height);
if (width < height) pg=createGraphics(width, width);

```

Then use what I did on  
[https://discourse.processing.org/t/solved-making-the-contents-of-a-frame-relative-to-its-size/3595/2](https://discourse.processing.org/t/solved-making-the-contents-of-a-frame-relative-to-its-size/3595/2)

---

_[View the full topic](https://discourse.processing.org/t/solved-fullscreen-sketch-scaling-and-preformance/3916)._
