Custom Loading Screens?

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1483
Joined: Mon Jun 19, 2017 11:35 am
Flair: Stargard
Contact:

Custom Loading Screens?

Postby Taycamgame » Mon Jan 20, 2020 3:56 pm

Loading screens, being the ones the player sees when loading into and out of levels while playing. Not the main SMBX2 loading screen, i mean the one that is just a black screen with the SMBX2 logo on the bottom right. I assume it's possible to replace that?
A few questions on making custom loading screens:
1. What size do they need to be?
2. I figure it should replace one of the hardcoded gfx, but I can't tell which one. I suspect it's hardcoded-1, hardcoded-14-1 or hardcoded-14-2 but Idk which one it is?
3. Can multiple different loading screens be available in a single episode, and can it be made so the player can choose which one to use throughout playing?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Custom Loading Screens?

Postby Emral » Mon Jan 20, 2020 4:20 pm

loadscreen.lua in the episode folder runs during load screens, automatically replacing the default. the lua environment is massively restricted, but you have access to all Graphics functions, as well as the onDraw event.
You can override an episode-wide loadscreen with a loadscreen.lua file in a level folder I THINK? Not sure.
To make the player be able to select a load screen, you need to pass some form of user data to loadscreen.lua. I beliiiiieve SaveData and GameData are not available, so you will probably need to use lua's IO library to handle your own custom file for that.Then you can manipulate that from regular gameplay, and access it from the load screen.
You might also want to keep this around, for loading images:
local episodePath = mem(0x00B2C61C, FIELD_STRING)
800x600 is your canvas size. Doesn't resize properly in preview builds, but that bug is fixed in beta 4, where it will scale like everything else in the game.

We'll make sure to add more thorough information about this to the handbook, but this should be enough to get you started.
Last edited by Emral on Mon Jan 20, 2020 4:41 pm, edited 1 time in total.

Murphmario
2025 Egg Hunter
2025 Egg Hunter
Posts: 2389
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: Custom Loading Screens?

Postby Murphmario » Mon Jan 20, 2020 4:35 pm

Also, I think the X2 logo on the loading screen is replacable. I found it in the hardcoded folder as hardcoded-30-5.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari