Background not scaling correctly

When I try to make a background for my new game, there seems to be a scaling issue. I tried scaling the thing up and down but it still didnt work. Can somebody please help me figure out how to have a painting asset automatically scale to fill the display?


Photo of the background asset

Photo of my code (I only have the background done rn)

Photo of the simulator/error

2 Likes

nope, the console thing (i forgot the name) is always 160 pixels wide and 120 pixels tall (ik there’s a way to change the size but idk how to use java).

1 Like

@Mega0star01 you can change it with this

t
just write that in java and you should be good to go
(you can change the size with the numbers)(you can’t change at an other point of the game)

2 Likes

There is a few things you can do about this. The first would just to make the background image bigger (160 by 120) pixels like mentioned above.
You could also use the zoom extension —> https://github.com/kiwiphoenix364/pxt-zoom
Another thing you could do is change the screen resolution. To do this switch to JavaScript and paste the following in:

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

Just change the numbers to what you want and switch back to blocks. It’s worth noting that the make code simulator is intended for a 3:2 width height ratio and 54:32 is not. So there will always be some missing space with this background, so I would edit the background into a 3:2 ratio.

2 Likes

i would use the scaling extentsion. Just keep in mind that you need to define the image as a seperate variable to work with the scaling blocks

2 Likes

or you just set the images resolution to the screen size and scale it to that