查看: 89|回复: 0
打印 上一主题 下一主题

[交流] UI

[复制链接]

4

主题

19

回帖

10

积分

Lv.1 新手木匠

UID
9726942
小麦
0
金锭
6
下界之星
0
跳转到指定楼层
楼主
发表于 2025-1-17 14:02:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式 IP:四川
在简易界面模版中有一个下拉框需要继承才能创建文件如下
{
    "ComboBoxExplainLabel": {
        "alpha": 1,
        "anchor_from": "bottom_middle",
        "anchor_to": "bottom_middle",
        "clip_offset": [
            0,
            0
        ],
        "clips_children": false,
        "color": [
            1,
            1,
            1
        ],
        "enabled": true,
        "font_scale_factor": 1,
        "font_size": "normal",
        "font_type": "smooth",
        "layer": 10,
        "line_padding": 0,
        "max_size": [
            0,
            0
        ],
        "min_size": [
            0,
            0
        ],
        "offset": [
            5,
            55
        ],
        "priority": 0,
        "propagate_alpha": false,
        "shadow": false,
        "size": [
            249,
            100
        ],
        "text": "说明:该场景展示了网易版下拉框的使用方法,点击下拉框可选择内容",
        "text_alignment": "center",
        "type": "label",
        "visible": true
    },
    "ComboSelectLabel": {
        "alpha": 1,
        "anchor_from": "top_middle",
        "anchor_to": "top_middle",
        "clip_offset": [
            0,
            0
        ],
        "clips_children": false,
        "color": [
            1,
            1,
            1
        ],
        "enabled": true,
        "font_scale_factor": 1,
        "font_size": "normal",
        "font_type": "smooth",
        "layer": 11,
        "line_padding": 0,
        "max_size": [
            0,
            0
        ],
        "min_size": [
            0,
            0
        ],
        "offset": [
            0,
            16
        ],
        "priority": 0,
        "propagate_alpha": false,
        "shadow": false,
        "size": [
            249,
            100
        ],
        "text": "未选中内容",
        "text_alignment": "center",
        "type": "label",
        "visible": true
    },
    "ExitButton@common.button": {
        "$control_alpha": 1,
        "$default_texture": "textures/netease/common/button/default",
        "$hover_texture": "textures/netease/common/button/hover",
        "$is_new_nine_slice": false,
        "$label_color": [
            1,
            1,
            1
        ],
        "$label_font_scale_factor": 1,
        "$label_font_size": "large",
        "$label_layer": 3,
        "$label_offset": [
            0,
            0
        ],
        "$label_text": "退出",
        "$nine_slice_buttom": 0,
        "$nine_slice_left": 0,
        "$nine_slice_right": 0,
        "$nine_slice_top": 0,
        "$nineslice_size": [
            0,
            0,
            0,
            0
        ],
        "$pressed_button_name": "%NeteaseComboBoxDemo.click",
        "$pressed_texture": "textures/netease/common/button/pressed",
        "$texture_layer": 2,
        "alpha": 1,
        "anchor_from": "bottom_left",
        "anchor_to": "bottom_left",
        "bindings": [
            {
                "binding_collection_name": "",
                "binding_condition": "always_when_visible",
                "binding_type": "collection_details"
            }
        ],
        "button_mappings": [],
        "clip_offset": [
            0,
            0
        ],
        "clips_children": false,
        "controls": [
            {
                "default@NeteaseComboBoxDemo.default": {}
            },
            {
                "hover@NeteaseComboBoxDemo.hover": {}
            },
            {
                "pressed@NeteaseComboBoxDemo.pressed": {}
            },
            {
                "button_label@NeteaseComboBoxDemo.button_label": {}
            }
        ],
        "draggable": "not_draggable",
        "enabled": true,
        "is_handle_button_move_event": true,
        "layer": 12,
        "max_size": [
            0,
            0
        ],
        "min_size": [
            0,
            0
        ],
        "offset": [
            0,
            0
        ],
        "priority": 0,
        "propagate_alpha": false,
        "size": [
            75,
            50
        ],
        "visible": true
    },
    "addComboBtn@common.button": {
        "$control_alpha": 1,
        "$default_texture": "textures/netease/common/button/default",
        "$hover_texture": "textures/netease/common/button/hover",
        "$is_new_nine_slice": false,
        "$label_color": [
            1,
            1,
            1
        ],
        "$label_font_scale_factor": 1,
        "$label_font_size": "large",
        "$label_layer": 3,
        "$label_offset": [
            0,
            0
        ],
        "$label_text": "加项",
        "$nine_slice_buttom": 0,
        "$nine_slice_left": 0,
        "$nine_slice_right": 0,
        "$nine_slice_top": 0,
        "$nineslice_size": [
            0,
            0,
            0,
            0
        ],
        "$pressed_button_name": "%NeteaseComboBoxDemo.click",
        "$pressed_texture": "textures/netease/common/button/pressed",
        "$texture_layer": 2,
        "alpha": 1,
        "anchor_from": "center",
        "anchor_to": "center",
        "bindings": [
            {
                "binding_collection_name": "",
                "binding_condition": "always_when_visible",
                "binding_type": "collection_details"
            }
        ],
        "button_mappings": [],
        "clip_offset": [
            0,
            0
        ],
        "clips_children": false,
        "controls": [
            {
                "default@NeteaseComboBoxDemo.default": {}
            },
            {
                "hover@NeteaseComboBoxDemo.hover": {}
            },
            {
                "pressed@NeteaseComboBoxDemo.pressed": {}
            },
            {
                "button_label@NeteaseComboBoxDemo.button_label": {}
            }
        ],
        "draggable": "not_draggable",
        "enabled": true,
        "is_handle_button_move_event": true,
        "layer": 2,
        "max_size": [
            0,
            0
        ],
        "min_size": [
            0,
            0
        ],
        "offset": [
            85,
            19
        ],
        "priority": 0,
        "propagate_alpha": false,
        "size": [
            100,
            50
        ],
        "visible": true
    },
    "button_label": {
        "alpha": "$control_alpha",
        "color": "$label_color",
        "font_scale_factor": "$label_font_scale_factor",
        "font_size": "$label_font_size",
        "font_type": "smooth",
        "layer": "$label_layer",
        "max_size": [
            "100%",
            "100%"
        ],
        "offset": "$label_offset",
        "shadow": false,
        "text": "$label_text",
        "text_alignment": "center",
        "type": "label"
    },
    "default": {
        "alpha": "$control_alpha",
        "is_new_nine_slice": "$is_new_nine_slice",
        "layer": "$texture_layer",
        "nine_slice_buttom": "$nine_slice_buttom",
        "nine_slice_left": "$nine_slice_left",
        "nine_slice_right": "$nine_slice_right",
        "nine_slice_top": "$nine_slice_top",
        "nineslice_size": "$nineslice_size",
        "texture": "$default_texture",
        "type": "image"
    },
    "hover": {
        "alpha": "$control_alpha",
        "is_new_nine_slice": "$is_new_nine_slice",
        "layer": "$texture_layer",
        "nine_slice_buttom": "$nine_slice_buttom",
        "nine_slice_left": "$nine_slice_left",
        "nine_slice_right": "$nine_slice_right",
        "nine_slice_top": "$nine_slice_top",
        "nineslice_size": "$nineslice_size",
        "texture": "$hover_texture",
        "type": "image"
    },
    "main": {
        "absorbs_input": true,
        "always_accepts_input": false,
        "controls": [
            {
                "neteaseComboBoxPanel@NeteaseComboBoxDemo.neteaseComboBoxPanel": {}
            }
        ],
        "force_render_below": false,
        "is_showing_menu": true,
        "render_game_behind": true,
        "render_only_when_topmost": true,
        "should_steal_mouse": false,
        "type": "screen"
    },
    "namespace": "NeteaseComboBoxDemo",
    "neteaseComboBoxPanel": {
        "alpha": 1,
        "anchor_from": "center",
        "anchor_to": "center",
        "clip_offset": [
            0,
            0
        ],
        "clips_children": false,
        "controls": [
            {
                "comboBoxPanel@combo_box.comboBoxPanel": {
                    "layer": 1,
                    "offset": [
                        7,
                        -65
                    ]
                }
            },
            {
                "addComboBtn@NeteaseComboBoxDemo.addComboBtn": {}
            },
            {
                "reduceComboBtn@NeteaseComboBoxDemo.reduceComboBtn": {}
            },
            {
                "ComboBoxExplainLabel@NeteaseComboBoxDemo.ComboBoxExplainLabel": {}
            },
            {
                "ComboSelectLabel@NeteaseComboBoxDemo.ComboSelectLabel": {}
            },
            {
                "ExitButton@NeteaseComboBoxDemo.ExitButton": {}
            }
        ],
        "enabled": true,
        "layer": 0,
        "max_size": [
            0,
            0
        ],
        "min_size": [
            0,
            0
        ],
        "offset": [
            0,
            0
        ],
        "priority": 0,
        "propagate_alpha": false,
        "size": [
            "100.0%+0.0px",
            "100.0%+0.0px"
        ],
        "type": "panel",
        "visible": true
    },
    "pressed": {
        "alpha": "$control_alpha",
        "is_new_nine_slice": "$is_new_nine_slice",
        "layer": "$texture_layer",
        "nine_slice_buttom": "$nine_slice_buttom",
        "nine_slice_left": "$nine_slice_left",
        "nine_slice_right": "$nine_slice_right",
        "nine_slice_top": "$nine_slice_top",
        "nineslice_size": "$nineslice_size",
        "texture": "$pressed_texture",
        "type": "image"
    },
    "reduceComboBtn@common.button": {
        "$control_alpha": 1,
        "$default_texture": "textures/netease/common/button/default",
        "$hover_texture": "textures/netease/common/button/hover",
        "$is_new_nine_slice": false,
        "$label_color": [
            1,
            1,
            1
        ],
        "$label_font_scale_factor": 1,
        "$label_font_size": "large",
        "$label_layer": 3,
        "$label_offset": [
            0,
            0
        ],
        "$label_text": "减项",
        "$nine_slice_buttom": 0,
        "$nine_slice_left": 0,
        "$nine_slice_right": 0,
        "$nine_slice_top": 0,
        "$nineslice_size": [
            0,
            0,
            0,
            0
        ],
        "$pressed_button_name": "%NeteaseComboBoxDemo.click",
        "$pressed_texture": "textures/netease/common/button/pressed",
        "$texture_layer": 2,
        "alpha": 1,
        "anchor_from": "center",
        "anchor_to": "center",
        "bindings": [
            {
                "binding_collection_name": "",
                "binding_condition": "always_when_visible",
                "binding_type": "collection_details"
            }
        ],
        "button_mappings": [],
        "clip_offset": [
            0,
            0
        ],
        "clips_children": false,
        "controls": [
            {
                "default@NeteaseComboBoxDemo.default": {}
            },
            {
                "hover@NeteaseComboBoxDemo.hover": {}
            },
            {
                "pressed@NeteaseComboBoxDemo.pressed": {}
            },
            {
                "button_label@NeteaseComboBoxDemo.button_label": {}
            }
        ],
        "draggable": "not_draggable",
        "enabled": true,
        "is_handle_button_move_event": true,
        "layer": 6,
        "max_size": [
            0,
            0
        ],
        "min_size": [
            0,
            0
        ],
        "offset": [
            -75,
            19
        ],
        "priority": 0,
        "propagate_alpha": false,
        "size": [
            100,
            50
        ],
        "visible": true
    }
}


命名空间.控件名称
combo_box.comboBoxPanel

就是下拉框的命名空间以及控件名称

=====================================

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

返回顶部