Page 1 of 1

Custom Loading Screens?

Posted: Mon Jan 20, 2020 3:56 pm
by Taycamgame
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?

Re: Custom Loading Screens?

Posted: Mon Jan 20, 2020 4:20 pm
by Emral
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.

Re: Custom Loading Screens?

Posted: Mon Jan 20, 2020 4:35 pm
by Murphmario
Also, I think the X2 logo on the loading screen is replacable. I found it in the hardcoded folder as hardcoded-30-5.