# Set arcade screen height to variable

**URL:** <https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688>\
**Category:** Help\
**Created:** [March 18, 2025, 12:02pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688 "2025-03-18T12:02:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [March 18, 2025, 12:02pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/1 "2025-03-18T12:02:01Z")

</div>

please help I want to make the arcade screen height and width to be changeable so I am asking is it possible

---

<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:** [March 18, 2025, 12:04pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/2 "2025-03-18T12:04:32Z")

</div>

Not possible, you cannot change screen size dynamically. You can try to fake with the zoom extension though

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [March 18, 2025, 4:49pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/3 "2025-03-18T16:49:52Z")

</div>

It is possible to change the screen size, but not while your program is running. Only once.  
This topic outlines how to do it:

> [@How did i just now discover this!](https://forum.makecode.com/t/how-did-i-just-now-discover-this/28961):
>
> If you type namespace userconfig { export const ARCADE\_SCREEN\_WIDTH = 320 export const ARCADE\_SCREEN\_HEIGHT = 240 } Into the java script editor, you just changed the screen size. You can input ANY SIZE! Why does nobody use this! I can make a game in 4k! (with low FPS but thats besides the point) There has been MANY times where I wished this was possible and now I find it IS?!??!?! Anyways I just wanted to share this so no one suffers as I did.

It only works in JavaScript, not blocks, so I would make a copy of your project before going into JaveScript and trying this.

---

<div class="post-metadata">

**Author:** ![CrunchyToast](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/crunchytoast/32/17780_2.png) [@CrunchyToast](https://forum.makecode.com/u/CrunchyToast)\
**Post date:** [March 18, 2025, 4:51pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/4 "2025-03-18T16:51:30Z")

</div>

Technically, you can zoom out of your view point but the screen borders and size are fixed unfortunately.

---

<div class="post-metadata">

**Author:** ![Ima.notarobot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ima.notarobot/32/26551_2.png) [@Ima.notarobot](https://forum.makecode.com/u/Ima.notarobot)\
**Post date:** [March 18, 2025, 4:53pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/5 "2025-03-18T16:53:14Z")

</div>

You can, just go to java script and convert it back into blocks it should look like this:

```auto
namespace userconfig {
    export const ARCADE_SCREEN_WIDTH = 160
    export const ARCADE_SCREEN_HEIGHT = 120
}

```

keep the screen size a 3.2 ratio or it will look strange.  
change the numbers however you want.

---

<div class="post-metadata">

**Author:** ![loganisdabest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/loganisdabest/32/20151_2.png) [@loganisdabest](https://forum.makecode.com/u/loganisdabest)\
**Post date:** [March 18, 2025, 4:53pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/6 "2025-03-18T16:53:40Z")

</div>

yeah I did that with digdigio

---

<div class="post-metadata">

**Author:** ![nutshellmakecode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nutshellmakecode/32/32653_2.png) [@nutshellmakecode](https://forum.makecode.com/u/nutshellmakecode)\
**Post date:** [March 18, 2025, 4:55pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/7 "2025-03-18T16:55:43Z")

</div>

you are wrong

> [@Is it possible to change the screen resolution?](https://forum.makecode.com/t/is-it-possible-to-change-the-screen-resolution/22001):
>
> Title. I love using Makecode Arcade and so do my students. Is it possible to increase the screen resolution just for games that run on PC instead of on arcade devices? So its currently 160 x 120. Imagine the possibilities if there was an option to scale it to 1024! open_mouth

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [March 18, 2025, 4:55pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/8 "2025-03-18T16:55:50Z")

</div>

oh thanks I thought you could change it if you turned into a variable

---

<div class="post-metadata">

**Author:** ![Danny\_Devention](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/danny_devention/32/30134_2.png) [@Danny\_Devention](https://forum.makecode.com/u/Danny_Devention)\
**Post date:** [March 18, 2025, 4:56pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/9 "2025-03-18T16:56:08Z")

</div>

Sucks you can’t change the aspect ratio. Wide screen makecode games would look awesome.

---

<div class="post-metadata">

**Author:** ![chronosify](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chronosify/32/10902_2.png) [@chronosify](https://forum.makecode.com/u/chronosify)\
**Post date:** [March 18, 2025, 4:56pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/10 "2025-03-18T16:56:18Z")

</div>

actually, you can add a small amount of javascript code to change the resolution like this

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/5/856a9164ca7e2d872dfd91f72d325424797f612c.png)

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [March 18, 2025, 6:17pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/11 "2025-03-18T18:17:57Z")

</div>

no I know about this but I want the screen height to not be a constant and instead be a variable

---

<div class="post-metadata">

**Author:** ![Bifrosty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bifrosty/32/24819_2.png) [@Bifrosty](https://forum.makecode.com/u/Bifrosty)\
**Post date:** [March 18, 2025, 7:13pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/12 "2025-03-18T19:13:49Z")

</div>

There is no way to change it from a constant. The closest you can get is to use the zoom extension → [https://github.com/kiwiphoenix364/pxt-zoom](https://github.com/kiwiphoenix364/pxt-zoom)  
Alternatively you could use the setttings extension to save all your game’s needed data and reset the simulator with a different resolution. I haven’t tried that ever though and I’m only 75% this second method works…

---

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [March 18, 2025, 7:15pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/13 "2025-03-18T19:15:55Z")

</div>

That is what brohann was answering. It is possible to change the screen resoluttion. But not after the game has started. So you can’t change the resolution mid game. Or make it a variable as you’re saying. But you could try to set the resolution to higher than what you actually need, and then use the zoom extension to to make it look like the right resolution. Then you can zoom out if you need to see more or similar.

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [March 19, 2025, 9:15pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/14 "2025-03-19T21:15:30Z")

</div>

yea thats at the start but you cant set it as a variable since that snippet is actually going deeper than usual into the “innerArcade” if thats a thing

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [March 19, 2025, 9:15pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/15 "2025-03-19T21:15:33Z")

</div>

yeah brohann knows that he meant u cant change it in the game

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [March 19, 2025, 9:15pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/16 "2025-03-19T21:15:35Z")

</div>

what if you replaced const with var or let

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [March 20, 2025, 12:42pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/17 "2025-03-20T12:42:07Z")

</div>

yup exactly I tried let and it no work

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [March 20, 2025, 1:41pm UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/18 "2025-03-20T13:41:51Z")

</div>

It is a const in the base arcade code, so unless you edit the base arcade code by forking the arcade repo and making your own, you can’t do that. Basically what you are doing here is overriding the base arcade const with your own, but you cannot replace it with a “let” because… I’ve tried and it doesn’t work.

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [March 21, 2025, 4:26am UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/19 "2025-03-21T04:26:50Z")

</div>

maybe in beta guys…@richard no?

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [March 21, 2025, 4:53am UTC](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688/20 "2025-03-21T04:53:21Z")

</div>

Who tried forking Arcade.pxt?

[Next page](https://forum.makecode.com/t/set-arcade-screen-height-to-variable/34688.md?page=2)
