Difference between render overlay and status bar class

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Difference between render overlay and status bar class

Post by Apeirogon »

What is the fundamental difference between render overlay event and status bar class?
Because, after looking in status bar class, I have a feeling that it just a over complicated render overlay event. Because it mostly use screen struct and texture manager for drawing stuff.
Plus, for me, logic of render overlay is more....more easy and understandable than status bar. Just two line, check for texture and for player, and I can draw amount of health. Or armor protecting value.

So, if I use render overlay to draw on a screen amount of health, ammo, keys and etc., instead of status bar, my PC dont explode and/or at me, from a dark corner of a room, dont jump someone from the developers of the gzdoom and wildly rolling his eyes cry "USE STATUS BAR CLASS FOR THIS!!!!!111"?
Or I did not notice something important when look through status bar class?
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Difference between render overlay and status bar class

Post by Apeirogon »

Anyone?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Difference between render overlay and status bar class

Post by Graf Zahl »

The status bar is so complicated because it needs to automatically handle user's scale and HUD mode settings.
As a result, the status bar comes with its own set of draw functions that can align the content to the edges of the screen or the center and put the contents of your status bar into a predefined rectangle of arbitrary size, where the user would expect it.

f you try to use the overlay you got to have to do all of this by yourself - and if you don't, your users will complain because your mod doesn't properly handle their preferred settings.
Ultimately, yes, the status bar is just an overlay, but with a large number of convenience functions added to it and a lot of implicit semantics to make it easier to create a HUD that automatically adjusts to user settings.
Post Reply

Return to “Scripting”