LunaLUA: How to add item box to a custom HUD

Share and discuss custom SMBX graphics.

Moderator: Userbase Moderators

Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

LunaLUA: How to add item box to a custom HUD

Postby Sambo » Sat Jan 03, 2015 7:38 pm

I have created a complete re-code of the item reserve box with LunaLUA:
Spoiler: show
128-nodither.gif
Using it is simple; just download the files and place them in your level's folder. Or if you want it for your whole episode, rename lunadll.lua to lunaworld.lua and place them in the episode folder instead.
Be careful not to overwrite your existing lunadll files. If you have lunadll.lua already, just add this to the onLoop function:

Code: Select all

	if reserve ~= player:mem(0x158, FIELD_WORD) then
		reserve = player:mem(0x158, FIELD_WORD)
		if reserve == 0 then
			loadImage("NONE", 5, 0xdc00ff)
		elseif reserve == 184 then
			loadImage("../HUD/smb_shroom.bmp", 5, 0xdc00ff)
		elseif reserve == 182 then
			loadImage("../HUD/smb_flower.bmp", 5, 0xdc00ff)
		elseif reserve == 9 then
			loadImage("../HUD/smb3_shroom.bmp", 5, 0xdc00ff)
		elseif reserve == 14 then
			loadImage("../HUD/smb3_flower.bmp", 5, 0xdc00ff)
		elseif reserve == 34 then
			loadImage("../HUD/leaf.bmp", 5, 0xdc00ff)
		elseif reserve == 264 then
			loadImage("../HUD/smb3_iceflower.bmp", 5, 0xdc00ff)
		elseif reserve == 169 then
			loadImage("../HUD/tanooki_suit.bmp", 5, 0xdc00ff)
		elseif reserve == 170 then
			loadImage("../HUD/hammer_suit.bmp", 5, 0xdc00ff)
		elseif reserve == 248 then
			loadImage("../HUD/stopwatch.bmp", 5, 0xdc00ff)
		elseif reserve == 185 then
			loadImage("../HUD/smw_shroom.bmp", 5, 0xdc00ff)
		elseif reserve == 183 then
			loadImage("../HUD/smw_flower.bmp", 5, 0xdc00ff)
		elseif reserve == 277 then
			loadImage("../HUD/smw_iceflower.bmp", 5, 0xdc00ff)
		end
		placeSprite(1, 5, 384, 30)
	end
Don't forget to include 'end' at the end of your functions.
NOTE: The custom HUD shown is not included.
Last edited by Sambo on Tue Jan 06, 2015 8:45 pm, edited 1 time in total.

DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

Re: LunaLUA: How to add item box to a custom HUD

Postby DarkShadeX » Sun Jan 04, 2015 7:28 am

Good job,i also wanted to do this but i was to lazy : P
I gonna use this for SMW -DIDL- so thank you.

Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

Re: LunaLUA: How to add item box to a custom HUD

Postby Sambo » Tue Jan 06, 2015 8:42 pm

You can remove the "local reserve" part of the code because it doesn't do anything and isn't necessary.

XerX
Phanto
Phanto
Posts: 1487
Joined: Fri Dec 20, 2013 3:33 pm

Re: LunaLUA: How to add item box to a custom HUD

Postby XerX » Wed Jan 07, 2015 1:13 am

So what does this do exactly?

SilverDeoxys563
Guest

Re: LunaLUA: How to add item box to a custom HUD

Postby SilverDeoxys563 » Wed Jan 07, 2015 1:27 am

If you can recreate the item box graphics, does this mean that you can basically recreate all the graphics used in the HUD without having to modify an EXE? Including the fonts?

DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

Re: LunaLUA: How to add item box to a custom HUD

Postby DarkShadeX » Wed Jan 07, 2015 11:38 am

You can draw a string/text using lunalua but it uses the original fonts.

HenryRichard
Reznor
Reznor
Posts: 2843
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: LunaLUA: How to add item box to a custom HUD

Postby HenryRichard » Mon Jan 12, 2015 10:18 pm

DarkShadeX wrote:You can draw a string/text using lunalua but it uses the original fonts.
Though you could make a function to display custom numerals (saved individually as .bmps) based on an integer...


Return to “Graphics”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari