Page 1 of 1

(SMBX2 LunaLua) How to make a custom screen size for your levels/worlds!

Posted: Tue Aug 27, 2024 2:05 pm
by STCGlevels
Tired of the same 4:3 size? This will help, and it's not just 16:9, but its anything!
Copy and paste this code into your lunalua!

Code: Select all

function onStart()
    Graphics.setMainFramebufferSize(width, height) --Enter width and height here.
end
function onCameraUpdate()
    camera.width, camera.height = Graphics.getMainFramebufferSize() --Don't change anything here.
end
Calculate aspect ratio
Screen sizes you can use:
Gameboy Advance: 900x600
Classic Nintendo: 600x600
16:9: 1072x603
Don't make it too small, or it won't look good. You can use the handycam zoom. You also have to modify some stuff if the level size is 4:3 or vertical or you could use the handycam zoom to make things quicker, the world map design has the be changed to 4:3 but if you're a pro or something then keep the size.

Hope this helped, have a good time! ;)

You don't need to credit me cus it's not really a custom script, it's just to change aspect ratio, you can if you want.
Proof:
Image

Re: (SMBX2 LunaLua) How to make a custom screen size for your levels/worlds!

Posted: Wed Aug 28, 2024 11:23 am
by Cat king
Using this can be quite useful, but I think it breaks autoscroll.lua because of the fact the invisible walls will not have been updated to the new screen size, and as far as I know you can't change the positioning and size of the walls very easily. It's very possible that using the code in the post fixes this, as I only just used handycam to zoom out.

Re: (SMBX2 LunaLua) How to make a custom screen size for your levels/worlds!

Posted: Sat Aug 31, 2024 11:18 am
by KurttheKing
This is nice, however the common 16:9 dimensions are 960x540

Re: (SMBX2 LunaLua) How to make a custom screen size for your levels/worlds!

Posted: Wed Feb 12, 2025 8:47 pm
by AlphaBlue1011
btw, if anyone wants to replicate a 3ds, 800x480 is a 15:9 or 5:3 screen size. might use that for an nsmb2 coin rush remake.