hello people, I have a question/problem with the slider, it does not have the function to increase its height and I need to “fatten” it because I plan to use it as a life bar for my life marker, so it would be perfect, but due to this problem I’m stuck here
for the purpose of exemplification:
has the health bar and the marking below in another color to identify which total life was lost, so when it reaches a threshold the code would change the color of the slider “on the left” to red to identify that it is close to death or green when is more alive than the other players Screenshot_20201104-125444~2|466x111
You can just use a H. Arrangement and a label for that. HA backgroundcolor =red, labelcolor=green. With a little logic you can decrease or increase the width of the label. So you get your health display.
I had exactly that same idea, even more using a card view to round the edges, but the problem is that data entry is volatile, life will go into a csv list variable, there are more than 40 characters with lives in mostly different
in this case above I would have to have a calculation pattern for each different life, but what I stuck in this idea was: how to apply it in the horizontal arrangement? I was thinking of using “horizontal arrangement width percentage” but how would I do if the character’s life was going to be over at the beginning? or for example decrease 5% directly each time I press one Button
to clarify I literally made a video of what I want to do
in short if I can’t adjust the height of the slider, then I have to create a slider, to serve as a life bar that I will decrease or increase with buttons and increase beyond the initial maximum
I’ll try, at the moment I just did it in a layout to test it, I’ll try something on it
#edit
okay, I managed to solve it with help in the chat, but as I already in other topics here, there is a need to clarify how it was solved
I solved it in the following way: I made 2 horizontal arrangements, one inside the other each in a color, then I worked on the arrangement in a percentage form, I made variables for this where I took this variable and divided it by what I wanted: in the case (100) representing 100% of the arrangement, and divided by a variable that is how much I want, I took the result that now represents 1 and put it to multiply by the damage that will enter, this value subtracted by the variable that carries the current size of the arrangement in percentage
this way it is 100% the way I wanted it, I just need to refine it, but if it is created in the variables of the project I did to do many things, I hope you can understand kkkkkkkkkkkl