#Grid Items

1 messages · Page 1 of 1 (latest)

versed merlin
#

How can I remove the first 3 buttons from my grid?? Help me

keen arrow
#

bind by button index and make index 0 to 2 invisible

versed merlin
boreal kite
# versed merlin 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...

▶ Play video
versed merlin
#

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"
      }
    ]
  }
keen arrow
versed merlin
keen arrow
#

view bindings

versed merlin
keen arrow
#

yeah

#

{
"binding_type": "view",
"source_property_name": "((#collection_index = 0) or (#collection_index = 1) or (#collection_index = 2))",
"target_property_name": "#visible"
}

boreal kite
boreal kite
#

pretty obvious, but i forgot lol

keen arrow
#

didn't know that tbh

versed merlin
# keen arrow { "binding_type": "view", "source_property_name": "((#collection_index = 0) ...
  "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

rose solar
#

"(not((#collection_index = 0) or (#collection_index = 1) or (#collection_index = 2)))"

alpine fog
#

this isnt grid

#

its just stack panel, while using grid bindigns with visiblity wouldnt work

rose solar
#

Exactly, i just change the code

versed merlin
#

It worked, thanks to you guys || @rose solar @keen arrow ||