#Grid Items
1 messages · Page 1 of 1 (latest)
bind by button index and make index 0 to 2 invisible
How can I do this?
https://www.youtube.com/watch?v=Hrpp2Ihg8lU&t=24s
dingsel covers button index in this video, and if you dont understand bindings, just look here: https://wiki.bedrock.dev/json-ui/json-ui-intro.html#bindings
🔥Topics covered in this video:
JSON UI Variables
JSON UI Sizes and Scaling
Bindings in JSON UI
Server Forms
Custom Buttons
🔗Links :
Last Video Part: https://youtu.be/zWecyvsbKHY
Join My Discord! : https://discord.gg/tzrmH56JXC
My Website And Code: http://skyls.de
JSON UI docs : https://wiki.bedrock.dev/json-ui/json-ui-intro.html
Vanilla RP : h...
I know how to use collection_index, but my script has a loop system for the buttons. So I don't want to use collection_index
My Code
"dynamic_buttons": {
"type": "grid",
"size": [
"100%",
"100%c"
],
"grid_dimensions": [
1,
99
],
"grid_item_template": "menus.dynamic_button",
"grid_fill_direction": "horizontal",
"grid_rescaling_type": "horizontal",
"anchor_from": "center",
"anchor_to": "center",
"factory": {
"name": "buttons",
"control_name": "menus.dynamic_button"
},
"collection_name": "form_buttons",
"bindings": [
{
"binding_name": "#form_button_length",
"binding_name_override": "#maximum_grid_items"
}
]
}
i meant #collection_index variable if i am not wrong
just do "((#collection_index = 0) or (#collection_index = 1) or (#collection_index = 2))"
What do you mean? Where do I put this in my code?
I'm sorry for my stupidity
view bindings
In the button bindings?
yeah
{
"binding_type": "view",
"source_property_name": "((#collection_index = 0) or (#collection_index = 1) or (#collection_index = 2))",
"target_property_name": "#visible"
}
dont think words with #s are variables, there was a name for them, i just forgot.
#bindings?
didn't know that tbh
"dynamic_button@common_buttons.light_text_button": {
"$pressed_button_name": "button.form_button_click",
"$button_font_scale_factor": 1.0,
"size": "$button_size",
"$new_ui_label_offset": [
0,
0
],
"$button_size": [
"95%",
40
],
"$button_text_binding_type": "collection",
"$button_text_grid_collection_name": "form_buttons",
"$button_type_panel": "menus.button_label",
"$border_visible": false,
//
"$btn_default": "textures/hash/menu/cor2",
"$btn_hover": "textures/hash/menu/cor3",
//
"$default_button_texture": "$btn_default",
"$hover_button_texture": "$btn_hover",
"$pressed_button_texture": "$btn_hover",
"bindings": [
{
"binding_type": "view",
"source_property_name": "((#collection_index = 0) or (#collection_index = 1) or (#collection_index = 2))",
"target_property_name": "#visible"
},
{
"binding_type": "collection_details",
"binding_collection_name": "form_buttons"
}
]
}
Now only the first 3 buttons appear
"(not((#collection_index = 0) or (#collection_index = 1) or (#collection_index = 2)))"
this isnt grid
its just stack panel, while using grid bindigns with visiblity wouldnt work
Exactly, i just change the code
It worked, thanks to you guys || @rose solar @keen arrow ||