#How do I add a texture like here but doing it in the server_form?

1 messages · Page 1 of 1 (latest)

south smelt
#

I would like to add a texture like this for each button (not the same for each button)

fervent briar
#

Just add the texture via scripting then move it using json ui like this:

{
    "image": {
        "type": "image",
        "layer": 20,
        "size": [
            24,
            24
        ],
        "offset": [
            0,
            "-7%"
        ],
        "anchor_from": "center",
        "anchor_to": "center",
        "bindings": [
            {
                "binding_name": "#form_button_texture",
                "binding_name_override": "#texture",
                "binding_type": "collection",
                "binding_collection_name": "form_buttons"
            },
            {
                "binding_name": "#form_button_texture_file_system",
                "binding_name_override": "#texture_file_system",
                "binding_type": "collection",
                "binding_collection_name": "form_buttons"
            },
            {
                "binding_type": "view",
                "source_property_name": "(not ((#texture = '') or (#texture = 'loading')))",
                "target_property_name": "#visible"
            }
        ]
    }
}
south smelt
fervent briar
# south smelt How do I say that the texture here is put for button 1?

With a grid or factory
Grid:

     "type": "grid",
     "size": [
         "100% - 4px",
         "100%c"
     ],
     "anchor_from": "top_middle",
     "anchor_to": "top_middle",
     "grid_rescaling_type": "horizontal",
     "grid_item_template": "selection_form.dynamic_button",
     "collection_name": "form_buttons",
     "bindings": [
         {
             "binding_name": "#form_button_length",
             "binding_name_override": "#maximum_grid_items"
         }
     ]
 }```
#

Factory:

  "long_form_dynamic_buttons_panel": {
    "type": "stack_panel",
    "size": ["100% - 4px", "100%c"],
    "offset": [2,0],
    "orientation": "vertical",
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",

    "factory":{
      "name": "buttons",
      "control_name": "server_form.dynamic_button"
    },

    "collection_name": "form_buttons",
    "bindings": [
      {
        "binding_name": "#form_button_length",
        "binding_name_override": "#collection_length"
      }
    ]
  },
south smelt