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

Share guides you have written for SMBX, and related tools here.
simonthecomputerguru
Koopa
Koopa
Posts: 15
Joined: Tue Jul 02, 2024 11:42 am
Pronouns: he/him

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

Postby simonthecomputerguru » Tue Aug 27, 2024 2:05 pm

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 the size too.

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

Cat king
Swooper
Swooper
Posts: 53
Joined: Thu Feb 29, 2024 1:04 pm
Flair: Mario kart wii is #1
Pronouns: he/him

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

Postby Cat king » Wed Aug 28, 2024 11:23 am

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.

KurttheKing
Dolphin
Dolphin
Posts: 90
Joined: Tue Mar 15, 2022 4:55 pm
Flair: Certified Nerd
Pronouns: He/Him
Contact:

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

Postby KurttheKing » Sat Aug 31, 2024 11:18 am

This is nice, however the common 16:9 dimensions are 960x540


Return to “Guides”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari