Adding New Things to the HUD/Creating A Menu

Status
Not open for further replies.
I'm trying to do an upgrade script where you use rings to upgrade player stats, shields, and unlocking new abilities by using banked rings/current rings collected in the level. But I don't know how to add a HUD. I wan't a few things to show up under the ring count (banked rings, a few of the shields upgrades) and then by pressing Toss Flag you can select things on the "menu" version of the HUD where the prices show up so you can upgrade things. The problem is... I don't know how to make the menu OR the HUD. I've tried looking at the wiki, but I'm still confused on doing any of this.
 
First of all, somebody already beat you to the punch, so, not to be rude or anything, but I would legitimately suggest changing your plans.

But as far as adding features to the hud, you'll want to add something along these lines to the bottom of your lua script (you can technically put it wherever you want, but as hud code generally executes last...)

Code:
local function drawhud(v, player, cam)

end
hud.add(drawhud)
from there, you'll want to have a look at these functions, that are for use inside that block. They do various things such as drawing text and sprites to the screen.

As far as making the menu itself goes, it's a pretty complicated process, which involves both drawing to the hud and manipulating player variables. It'd take way too long to explain, so I suggest looking at the script I already made. The start of the shop menu code is labeled, so you shouldn't be able to miss it.
 
First of all, somebody already beat you to the punch, so, not to be rude or anything, but I would legitimately suggest changing your plans.

But as far as adding features to the hud, you'll want to add something along these lines to the bottom of your lua script (you can technically put it wherever you want, but as hud code generally executes last...)

Code:
local function drawhud(v, player, cam)

end
hud.add(drawhud)
from there, you'll want to have a look at these functions, that are for use inside that block. They do various things such as drawing text and sprites to the screen.

As far as making the menu itself goes, it's a pretty complicated process, which involves both drawing to the hud and manipulating player variables. It'd take way too long to explain, so I suggest looking at the script I already made. The start of the shop menu code is labeled, so you shouldn't be able to miss it.

Thank you! BTW, yes I know of the mod. I've had it on my PC for a while now. It's actually my inspiration for trying to mess with the HUD.
 
Does anyone have a list of where the score, time, rings, and lives coordinates are to use as a refrence? I can just guess, but a refrence would be nice to have.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top