hudCreator.lua - Create your own huds! [v1]

Share and discuss custom LunaLua code and content packs for SMBX2.
Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

hudCreator.lua - Create your own huds! [v1]

Postby Marioman2007 » Thu Jan 26, 2023 8:29 am

Hi. It's me again, this time with a custom hud creation library.
If you wanna know how easy this makes creation of custom huds, the hud in the gif has 8 hudCreator.addElement calls and 3 custom drawing functions.

GIF:
Spoiler: show
Image
(Example included with download)

Features:
- Automatically draws the cross symbol and text (can be turned on/off).
- Option to draw a backdrop behind the element.
- Option to hide it when a player (or specified npc) is overlapping.
- Option to hide it when the players are not still.
- And many more customizable options!

Limitations:
- User has to provide their own code for splitscreen/multiplayer.

Special Thanks:
Hoeloe for helping me learn about glDraw and capture buffers.

Download:
https://drive.google.com/file/d/1a60MT_ ... sp=sharing

Enjoy and give credit if used!
Documentation given in [documentation].txt.

MarioChallengerX2
Bit
Bit
Posts: 77
Joined: Sat Dec 31, 2022 4:34 pm
Pronouns: he/him

Re: hudCreator.lua - Create your own huds! [v1]

Postby MarioChallengerX2 » Thu Jan 26, 2023 8:06 pm

Wow. This is utterly amazing! Finally, an easy way to make these!

(Note, might want to put that in your signature so others will use it more!)

Mal8rk
Blooper
Blooper
Posts: 199
Joined: Mon Oct 25, 2021 11:04 pm
Flair: English Speaking Spanish Speaker
Pronouns: He/Him
Contact:

Re: hudCreator.lua - Create your own huds! [v1]

Postby Mal8rk » Wed Aug 09, 2023 7:34 pm

Is there a way to make an element (coin-like counter) that uses anothercurrency currencies?

Marioman2007
Lakitu
Lakitu
Posts: 462
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: hudCreator.lua - Create your own huds! [v1]

Postby Marioman2007 » Wed Aug 09, 2023 10:19 pm

Mal8rk wrote:
Wed Aug 09, 2023 7:34 pm
Is there a way to make an element (coin-like counter) that uses anothercurrency currencies?

Code: Select all

hud.addElement("coins", {
    img           = Graphics.sprites.hardcoded["33-2"].img,
    font          = font,
    x             = 32,
    y             = 16,
    hideOverlap   = true,
    direction     = hud.DIR_LEFT,
    stillBehavior = true,
    getFunc       = function() return coinCounter:getMoney() end,
})
Here, coinCounter is your ac currency.

Mal8rk
Blooper
Blooper
Posts: 199
Joined: Mon Oct 25, 2021 11:04 pm
Flair: English Speaking Spanish Speaker
Pronouns: He/Him
Contact:

Re: hudCreator.lua - Create your own huds! [v1]

Postby Mal8rk » Thu Aug 10, 2023 7:35 pm

Marioman2007 wrote:
Wed Aug 09, 2023 10:19 pm
Mal8rk wrote:
Wed Aug 09, 2023 7:34 pm
Is there a way to make an element (coin-like counter) that uses anothercurrency currencies?

Code: Select all

hud.addElement("coins", {
    img           = Graphics.sprites.hardcoded["33-2"].img,
    font          = font,
    x             = 32,
    y             = 16,
    hideOverlap   = true,
    direction     = hud.DIR_LEFT,
    stillBehavior = true,
    getFunc       = function() return coinCounter:getMoney() end,
})
Here, coinCounter is your ac currency.
wait, I just found something. the library hides MDA Yoshi's star counter




Image


Return to “LunaLua”

Who is online

Users browsing this forum: MiiK and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari