# How hardware handles increased screen sizes (what I found)

**URL:** <https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847>\
**Category:** Help\
**Tags:** graphics-and-math\
**Created:** [December 7, 2023, 6:29pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847 "2023-12-07T18:29:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [December 7, 2023, 6:29pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/1 "2023-12-07T18:29:04Z")

</div>

**Disclaimer:** This post is for documentation and education purposes, to help someone who wonders about this same question in the future (if they know how to use the search bar)

I used an unmodified [Adafruit PyGamer](https://www.adafruit.com/product/4242) to conduct this experiment

* * *

I was recently wondering how hardware handles scaling the screen with this method:

```js
namespace userconfig {
    export const ARCADE_SCREEN_WIDTH = <width>;
    export const ARCADE_SCREEN_HEIGHT = <height>;
}

```

This method works in the simulator (browser), but you obviously can’t display an image larger than `160x120` (MakeCode’s native resolution) on a `160x120` screen (the screen most arcade devices are equipped with).

So, I wanted to experiment and find out what happens if I try anyway. My hypotesis was that I was going to reach one of the following outcomes:

1. The device panics and crashes
2. The device crops the screen to display to show the top left `160x120` area
3. The device crops the screen, but the middle instead of the top left
4. Arcade compiles with `160x120` in mind and pretends that the resolution was never changed

If you don’t want to listen to my yapping, and just want an answer, it’s **NUMBER 4**  
If you do, stick around for the rest of my “report”.

After testing this out, I came to a conclusion. First and foremost, the project in fact compiled to my PyGamer with no issues, so I can rule out number 1. After loading the following code to the device, it’s immediately apparent we’re looking at the top left corner, so number 3 is also out of the question.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/642896132561735d5a458930672405221dce672d.png)

The size in the simulator is set to `320x240`  
(Upon loading this example to the device, we can see the tan colored top left corner)

 ![unnamed](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/1ec0dfb6f3c59cbc76fa456c62a2637709b988c6.jpeg)

(It’s hard to tell due to the lighting, but the screen is entirely tan)

Finally, it’s up to decide between options 2 and 4. You might notice the added debug text that logs the screen size on both devices, and that’s the final piece of the puzzle: when the code is compiled for hardware, the custom resolution is completely ignored! Why? Because the `userconfig` settings are only meant for the simulator, and they’re usually unachievable on hardware anyway.

* * *

So, that concludes my experiment, and I hope it comes in handy at some point to somebody. If you want to add something, feel free to expand on this here in the replies if you have a device to do this on. It would be great if somebody would also test sprite and tilemap behaviour in these circumstances, becuase i’m just not bothered to do so.

> **Nerd yaps for way too long**
>
> Then, one final question remains: why? What is the point of this? Well, for one this post exists because it was on my todo list. However, the real point is practical application for bigger games/projects. Say, you want to enable simulator users to choose a bigger resolution for your game when playing in the browser, becuase you can. Now, you can’t change the resolution on runtime, but a possible solution is to use [a method](https://forum.makecode.com/t/multiplayer-with-hardware-and-blocks/1171/7) to check if you’re running in sim, and if you are just draw everything across the whole screen. Otherwise, draw everything to the top left `160x120` because that’s what you’re going to see on hardware or something along those lines. I would need to actually make that to verify it, but it _sounds_ possible and that’s good enough for me.

That’s all I’ve got for today, toodles!

---

<div class="post-metadata">

**Author:** ![ChimbroDaPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chimbrodapro/32/15852_2.png) [@ChimbroDaPro](https://forum.makecode.com/u/ChimbroDaPro)\
**Post date:** [December 7, 2023, 9:58pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/2 "2023-12-07T21:58:47Z")

</div>

Interesting, considering I’m planning on making a HD (non-pixelated) game with this method.

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [December 7, 2023, 9:59pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/3 "2023-12-07T21:59:08Z")

</div>

This sounds really interesting! (pls try to verify this make this an extension it would be sooo helpful)

---

<div class="post-metadata">

**Author:** ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)\
**Post date:** [December 8, 2023, 12:15am UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/4 "2023-12-08T00:15:40Z")

</div>

I did a similar test pretty much a year ago and got the same results .I guess you probably already know that you can still shrink the screen size(I have no idea why you would do that). One interesting piece of hardware is the elecfreaks retro arcade. When I changed the screen size it cropped it as does the pygamer. However, the screen resolution is actually 320x240 so changing the screen size should be able to work is we modify the bootloader or something. There is also the chance that the elecfreaks retro arcade resizes the screen in the hardware, not the software, so if that is the case than it would not be possible.

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [December 8, 2023, 12:16am UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/5 "2023-12-08T00:16:42Z")

</div>

Awesome experiment! I love these long research posts : ) Good to know!

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [December 8, 2023, 7:05pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/6 "2023-12-08T19:05:22Z")

</div>

I don’t wanna kill your buzz, but if you’re considering 1080p or 720p resolutions, I doubt that’s possible. It would probably be incredibly laggy, and images in the editor can scale up to 512x512.

Also, editing them would be a misery because arcade starts suffering when you’re editing big pics, so yeah…

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [December 8, 2023, 8:01pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/7 "2023-12-08T20:01:05Z")

</div>

Yeah sprites from 200x200 get real laggy in the image editor

---

<div class="post-metadata">

**Author:** ![ChimbroDaPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chimbrodapro/32/15852_2.png) [@ChimbroDaPro](https://forum.makecode.com/u/ChimbroDaPro)\
**Post date:** [December 8, 2023, 9:18pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/8 "2023-12-08T21:18:04Z")

</div>

Oh ok lol. Better truth than consequences. Thanks Mr. @Sarge.

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [December 11, 2023, 5:25pm UTC](https://forum.makecode.com/t/how-hardware-handles-increased-screen-sizes-what-i-found/24847/9 "2023-12-11T17:25:09Z")

</div>

Also, here’s the experimental project I used for this, I forgot to share it

> **[Screen size test](https://arcade.makecode.com/S30174-27174-17099-28268)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.
