HUD being messed up by lighting system

0 favourites
  • 3 posts
From the Asset Store
Use this epic life system with hearts like famous games in your game!
  • So, I just implemented a lighting system that works like the one in A Link to the Past (dark maps, only a small radius of self-sight, lantern to light torches that brighten the room, etc) but I've noticed it's messing with part of my HUD. I'm using the sort of setup where the player's sight circle is a white circle with destination out, and an additional layer that puts a slightly transparent black cover over anything under the HUD. Everything else works fine, but the spritefont I'm using is ignoring the fact that it's on a HUD layer (parallax = 0), and starts moving instead of staying put. Since the lighting system is on it's own layer, moving it above the HUD layers fixes the issue but borks the HUD in a different way as the HUD is now dark if you move the Shadows layer to be the topmost layer.

    I know the solution would be to use a Text object instead, but I care a tiny bit about the text appearance as that's why I opted for using a Spritefont instead. It's not necessary as I don't mind switching to a text object to display Rupee/Bombs/Arrows count, but a solution would be awesome.

    Capx link

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • LaDestitute

    ok, I took a quick look, and the problem is in the Main event sheet - On Start of Layout. You create the Rupees object on layer 4. But your HUD layers are now 5 and 6. (Since you probably inserted a new layer to be the Shadows layer). Create Rupees on layer 5 or 6 and it works fine.

    It is a good idea to always reference layers by name, not their id number. That way you don't have to worry about inserting new layers... So, create Rupees on layer "BottomHUD" instead of 5, and then it will always work regardless of how many layers you add or delete (unless you delete the bottomHUD layer of course, lol)

    One time while testing and going into one of the houses I ended up out side the house some how... I did look at the code but there is some bug in there somewhere when you enter a house. (it only happened once - although, I didn't try very many times).

  • Thanks for the advice, that fixed it.

    Also, I'll try looking into the house bugs, thanks. I've encountered it before, but I was tired last night.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)