And what I mean by that is, draw an image on screen that can be moved around when some condition is met.
For example, I want to put a bar in my HUD that has the map name, but since map names vary so much in length, I wanted to know if there is a way to just draw the "end" of the bar right after the level name, so the bar never exceeds more than a few pixels after the level name. Essentially, the end of the bar moveswith the end of the level name dynamically.
I hope that makes sense. If anyone could help that'd be great.
Is there a way to draw an image dynamically on a HUD?
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!)
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!)
- Dan_The_Noob
- Posts: 880
- Joined: Tue May 07, 2019 12:24 pm
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Is there a way to draw an image dynamically on a HUD?
well how do you plan to measure level length?
Re: Is there a way to draw an image dynamically on a HUD?
Once you got the level name accessible as a string, you should be able to do this:
YourCurrentFont.StringWidth(LevelNameStringHere) to get the width of the string, then clip the bar drawing to that.
YourCurrentFont.StringWidth(LevelNameStringHere) to get the width of the string, then clip the bar drawing to that.
Re: Is there a way to draw an image dynamically on a HUD?
I'm not following entirely. How would I format it with this code I'm using?:kodi wrote:Once you got the level name accessible as a string, you should be able to do this:
YourCurrentFont.StringWidth(LevelNameStringHere) to get the width of the string, then clip the bar drawing to that.
Code: Select all
drawstring CONFONT, white, levellump, 9, 6, 0, alignment (left);
drawstring CONFONT, white, levelname, 60, 6, 0, alignment (left);Re: Is there a way to draw an image dynamically on a HUD?
anyone else able to help me with this?
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Is there a way to draw an image dynamically on a HUD?
No, not with SBARINFO. That is totally static.
If you want more dynamic effects you'll have to code your HUD in ZScript.
If you want more dynamic effects you'll have to code your HUD in ZScript.
Re: Is there a way to draw an image dynamically on a HUD?
Ok. Thank you.Graf Zahl wrote:No, not with SBARINFO. That is totally static.
If you want more dynamic effects you'll have to code your HUD in ZScript.