"namespace": "hud",
"hud_actionbar_text/actionbar_message": {
"$atext": "$actionbar_text",
"visible": "(not (not ($atext = $update_bar_1) and not (($atext - $update_bar_1) = $atext)))"
},
"stamina": {
"type": "label",
"offset": [ 229, -40 ],
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"layer": 10,
"text": "($atext - $update_bar_1)",
"$atext": "$actionbar_text",
"visible": "(not ($atext = $update_bar_1) and not (($atext - $update_bar_1) = $atext))"
},
"stamina_factory": {
"type": "panel",
"factory": {
"name": "hud_actionbar_text_factory",
"control_ids": {
"hud_actionbar_text": "[email protected]"
}
}
},
"root_panel": {
"modifications": [
{
"array_name": "controls",
"operation": "insert_front",
"value": {
"[email protected]_factory": {}
}
}
]
}
}
#I removed the text from the action bar, but I can't remove the background, how do I do it?
1 messages · Page 1 of 1 (latest)
nvm i fixed this
How did you make the custom bar work?
Couldn't reply as I don't remember and I won't be home until next week.
I can text you next week.
Sure that'd fine and thanks
place this and disappear
"hud_actionbar_text": {
"type": "image",
"anchor_from": "top_middle",
"anchor_to": "top_middle",
"size": [ "100%c + 12px", "100%c + 5px" ],
"offset": [ 0, "50%-68px" ],
"texture": "textures/ui/hud_tip_text_background",
"alpha": "@hud.anim_actionbar_text_background_alpha_out",
"$atext": "$actionbar_text",
"visible": "(not (not ($atext = $update_bar_1) and not (($atext - $update_bar_1) = $atext)))",
"controls": [
{
"actionbar_message": {
"type": "label",
"anchor_from": "center",
"anchor_to": "center",
"color": "$tool_tip_text",
"layer": 31,
"text": "$actionbar_text",
"localize": false,
"alpha": "@hud.anim_actionbar_text_alpha_out",
"$atext": "$actionbar_text",
"visible": "(not (not ($atext = $update_bar_1) and not (($atext - $update_bar_1) = $atext)))"
}
}
]
}
Hey question, do you know how to make a custom bar?
what type of bar?
bossbar ?
or something similar ?{
Like e.g a mana/energy/stamina bar following a scoreboard?
You mean that the score level is displayed in the form of, for example, the ambre bar
that ?
No like a score(health) 1 - 10 then it displays like 1 heart when the score is at 1, 2 hearts at 2 and so on
Ohhh yes
yes I know how to do that
wait while I do it
Oh thank you I'd really appreciate. Don't rush I have all day + the weekend
only there is one problem, this is possible only with title, not with actionbar
Title like /title?
This is only possible since it is with binding and binding does not work in actionbar
/title @a title...
Ah I see I think I can do it like that just fine thanks anyway
Oh but can you change the titles location to like the side of the screen?
Yes, in a moment I will send you the code
Thanks
you position it where you like
I just realized I don't know how to do it with /title @a title. So could you help me with that? I don't know how I would place the images
you won't have to do anything
You will only need to place the percentage
Oh nice
This is the result, is it okay?
the title letters can be removed
Yeah it's fine tha k you
Sorry for the late reply
@forest lichen
how to use
-
in $clip_max you must enter the maximum percentage it will have, for example I put 5 and don't forget the .0, it is very important
-
in texture you must place the image with the number of indicators, as in the image I sent below
-
in $string_bar you must place a word to execute said counter, for example, I used IndicatorBar:
what would be IndicatorBar: + percentage
the title will be seen
/title @a title IndicatorBar:10
- in size you should put the percentage of x that you like, but in y you should multiply the size of x * percentage
For example I put 16
it would
16*5=80
80 is the size of y
it would work correctly
Remember to take the image as a reference, in the image there are 5 hearts, so the maximum percentage is 5, you place the ones that are necessary
the code is the following:
"example_bar": {
"type": "panel",
"size": [0, 16],
"controls": [
{
"bar": {
"$clip_max": 5.0,
"texture": "textures/ui/example_bar",
"$string_bar": "IndicatorBar:",
"size": [16, 80],
"type": "image",
"layer": 2,
"clip_direction": "left",
"clip_pixelperfect": true,
"keep_ratio": false,
"offset": [0, -40],
"bindings": [
{
"binding_name": "#hud_title_text_string"
},
{
"binding_type": "view",
"source_property_name": "(#hud_title_text_string - $string_bar)",
"target_property_name": "#texto"
},
{
"binding_type": "view",
"source_property_name": "(#texto * 1)",
"target_property_name": "#ratio"
},
{
"binding_type": "view",
"source_property_name": "(($clip_max - #ratio) / $clip_max)",
"target_property_name": "#clip_ratio"
},
{
"binding_type": "view",
"source_property_name": "(($clip_max - #ratio) / $clip_max)",
"target_property_name": "#clip_ratio"
}
]
}
}
]
}
"hotbar_panel": {
"type": "panel",
"size": ["100%c", 22],
"anchor_from": "bottom_middle",
"anchor_to": "bottom_middle",
"controls": [
{
"@hud.example_bar": {}
},
{
"stackpanel_hotbar": {
"type": "stack_panel",
"orientation": "horizontal",
"size": [ "100%c", 22 ],
"anchor_from": "bottom_middle",
"anchor_to": "bottom_middle",
"controls": [
{ "[email protected]_start_cap": {} },
{ "[email protected]_elipses_panel_left_content": {} },
{ "[email protected]_grid": {} },
{ "[email protected]_elipses_panel_right_content": {} },
{ "[email protected]_end_cap": {} }
]
}
}
]
},
here is the texture if you want to try it
Thank you so much and extar thanks for the explanation
Yes you're welcome
Do the 2 sets of code go in 1 file or 2?
is 1
hud_screen
just copy and paste
Okay
How do i change the value? /title ...?
Excuse me, what do you mean?
Like let's say the 5 is the health how would I remove and add health?
Oh no nevermind I see now
But how do I remove the title text in the middle of the screen?
if you used scores
I think there is a way to put the score value in the title.
oh sorry I forgot
You will have to put the $string_bar here again
"hud_title_text/title_frame/title": {
"$string_bar": "IndicatorBar:",
"modifications": [
{
"array_name": "bindings",
"operation": "insert_back",
"value": {
"binding_type": "view",
"source_property_name": "(#text - $string_bar)",
"target_property_name": "#visible"
}
}
]
}
What do you mean? I copy ans paste in hud_screen
yes
Could you check if I've done it right
Yes! it is perfect
You can create more but you have to modify the json a lot more
Like in a way I'd have to do the same thing twice?
No, since we will use only 1 title since you cannot put 2 titles at the same time, we would have to do 2 in 1
and in the code the binding would be different
Oh I see
I'll try later on so if I need help I'll ask you or on json ui
Perfect, if you want, make an example of what it would be like with 2 so you can base yourself on it.
I got errors
mojang changed some things and the truth is I don't know what the error is since apparently everything is fine
Oh okay I tweak around with it and try to figure it out
perfect
Here is the code for 2 bars if you are interested
Thank you I am. Thanks alot
that is only possible up to number 9
If you put more than 9 it could be damaged
Ok
Is it posibile to clip from up going down and set background pieces?
Sorry I do not understand
Let me try showing
You gave
Can I make it like
oh ok ok wait what am I looking for
Instead of it going like 👉 it goes like 👇
you have to modify in the code, where it says clip_direction;
If you want it to start from the top down I think it's up
from bottom to top is down
the image should also be that way
Yeah that's how my image is so I was worried I'd had go change it
One last thing how can I add a background part for each bar?
wait for me to send you an example
Okay
something did
Thabk you
👍
Idk why but if you make to many bar, ui gonna be slow , i mean it cannot load fast
I'm ending at 2
._. I have jusst make only 5 bar and my ui now cannot load fasst
Thats unfortunate
Could you help me with my two bars?
Like my stamina point is at it min point but the bar need 1-2 sec to show the min ui
._. My code kinda different with the code you get up thire
I think my ui problem is that in your system we use something like
title @a title ui_1:1ui_2:1
But in my system it like
title @a title ui_1:1
title @a title ui_2:1
I using preserve title text see we can split the command and the ui will still work , but it get the problem when i make ao many ui and i think that my system got break
Oh I see
You know stamina and roll addon
That the perfect thing we can get
But i cant understand how that ui work
That addon dev (kamii) he using so many elements that i event doesn't know what it using for :)?
Yeah addons become confusing sometime 🥲
Not the script im just confused at the ui 😭😭😭
I'm struggling with both 😢
How did you get rid of the title in the middle of the screen
You mean make it disappear
Yes
@pine kernel
Sorry for the ping
I think I made a mistake
The 3 images sizes are [5, 101]
Everything together
It already works, you must be careful with the small details.
the binding of 1 is different from 2
and depending on the text you place the values may vary
to remove text on screen
"hud_title_text/title_frame/title": {
"$string_bar": "oxygen_bar",
"modifications": [
{
"array_name": "bindings",
"operation": "insert_back",
"value": {
"binding_type": "view",
"source_property_name": "(#text - $string_bar)",
"target_property_name": "#visible"
}
}
]
}
@pine kernel im really sorry for necroposting, but ive got a few questions
im thinking of making two bars using actionbar, one above the hotbar and the other below crosshair using glyphs (or above the hotbar if the crosshair does not exist)
- can those break actionbar?
- ill be using scripts to set the actionbar, does it work similar to the title one?
nvm got them working
@pine kernel sorry for the ping but i trying to do seperate bar like Bar_1 for bar1 and Bar_2 for bar2 but it doesn't work
use this template instead, should be more flexible
also you mightve noticed the '%.7s' part
this gets the first '7' letters from the string
idk if you did make sure of that but im saying just in case
also beware that i didnt make the UI to stay when another title appears, im still a newbie so i cant get that to work
ty thought but the json u send just make every things in HUD dissaper
idk why thought
it should be like this (except for texture + there would be another ui element)
just make sure youre not overwriting hotbar (the one you sent one does)
[UI][error]-UI Control: hud_screen | UI Control: variables_button_mappings_and_controls | UI Control: safezone_screen_matrix | UI Control: inner_matrix | UI Control: safezone_screen_panel | UI Control: root_screen_panel | ----------------------------------------------------
Unknown properties found in def[root_panel] from namespace[hud]
- Unknown property [modifications]
it have this error and make every HUD element dissaper
uh
do you have a root panel already
or smth?
hmmm why isnt hud recognizing root panel
that explains
np
it still doesnt preserve the bar so be careful
im trying to figure out how to do preserved title
im still want this so if u onl can u teach me how pls
whats the issue
it switch to another bar when fill it
you should differenate each hotbar's variables
i cant really help with json ui
oh tysm