Page 1 of 1

Custom Counters in HUD? (Purple Coin Challenge)

Posted: Thu Jul 09, 2020 7:25 pm
by Unknown68D
Hello! One of the levels in my episode makes use of collecting 100 purple coins to reveal a star after they are all collected. It works fine in its current state using the "No More Objects in Layer" event. However, I was wondering if it would be possible to implement a custom counter in the HUD specific to this level. It would work along the lines of this: If an NPC is collected (Death Event), increase the counter in the HUD by 1. In addition, are there any good images that would represent purple coins similar to how the count counter has a yellow coin image beside it? Thank you!
Image

Re: Custom Counters in HUD? (Purple Coin Challenge)

Posted: Sat Jul 11, 2020 5:11 pm
by MrDoubleA
If you want any custom HUD element, you can do this:

Code: Select all

local function myHUDElement(camIdx,priority,isSplit)
    -- Do stuff here
end

Graphics.addHUDElement(myHUDElement)
... or, if you want to override the HUD entirely, you can do this:

Code: Select all

local function myCustomHUD(camIdx,priority,isSplit)
    -- Do stuff here
end

Graphics.overrideHUD(myCustomHUD)
-- (or Graphics.overrideOverworldHUD for the overworld)
I'll send you the code for the purple coin counter through discord shortly.