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

Share guides you have written for SMBX, and related tools here.
STCGlevels
Bob-Omb
Bob-Omb
Posts: 20
Joined: Tue Jul 02, 2024 11:42 am
Flair: I make levels
Pronouns: he/him

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

Postby STCGlevels » 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 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
Last edited by STCGlevels on Sat Oct 19, 2024 6:55 am, edited 1 time in total.

Cat king
Bit
Bit
Posts: 62
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
Hoopster
Hoopster
Posts: 112
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 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari