Set HUD component width to variable

Hi, I have a xp bar that should go from one side of the screen to the other. But when I change the window resolution it stays the same size and only have the same placement.

Is it possible to get the window width/resolution and use it on the width parameter of the xp bar?

Hey @Dkol!

I’m not sure how to do exactly what you’re wanting here, but I THINK this set of nodes here could be put to use! You can grab the X from “Get Viewport Size”, divided by 2 is the halfway point, with 0 and the whole value as either end! :slight_smile:

image

Hi @Mind-Brain!

I don’t know if it’s supposed to but when I used the nodes you sent, it returned 0 for both X and Y but I managed to get the resolution using these nodes:

nodes to get width

But what I want is to know if I could bind the progress bar width to a function the same way you can bind other components like the Percent of the bar or use another method to set it to my Window Width variable when the player starts the game.