SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 10-19-2017   #1
Yoshirocks90
Eh, maybe later.
 
Yoshirocks90's Avatar
Default Adding New Things to the HUD/Creating A Menu

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.
Yoshirocks90 is offline   Reply With Quote
Old 10-19-2017   #2
LunarDestroyer
 
LunarDestroyer's Avatar
Default

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.
LunarDestroyer is offline   Reply With Quote
Old 10-19-2017   #3
Yoshirocks90
Eh, maybe later.
 
Yoshirocks90's Avatar
Default

Quote:
Originally Posted by LunarDestroyer View Post
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.
Yoshirocks90 is offline   Reply With Quote
Old 10-19-2017   #4
Yoshirocks90
Eh, maybe later.
 
Yoshirocks90's Avatar
Default

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.
Yoshirocks90 is offline   Reply With Quote
Old 10-19-2017   #5
Lach
Latch? Lock?? Lack???
 
Lach's Avatar
Default

https://wiki.srb2.org/wiki/Heads-up_...m_modification

The wiki is your best friend. Always.
Lach is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:14 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.