#pause_screen.jsonでボタンを押したときにモーダルを表示する

1 messages · Page 1 of 1 (latest)

dense birch
#

uiについての質問で、

{
  "namespace": "pause",
  "[email protected]_background": {
//
    "controls": [
//
   {
       "[email protected]_button": {
       "$button_text": "Click me!",
       "$pressed_button_name": "button.menu_exit"
   }
}
//{ "[email protected]_button": {} }

現在このように元の画面に新しいボタンを追加しているのですが、このボタンを押したときに、変数を変更したりしてモーダルのようなものを表示させたいのです。どのようにすればよいでしょうか

quartz raven
dense birch
#

トグルをボタンと同じ見た目にすることはできるでしょうか。
トグルの状態を変更することは可能でしょうか。

また、テストでトグルを作ってpause_screenのbutton_panelのcontrolsに追加したのですが、画像のようにボタン全体が上のほうにずれて、追加したトグルは見当たりません。

現在のコードです。

{
                            "quit_button_custom": {
                                "type": "toggle",
                                "layer": 10,
                                "$button_text": "Click me!",
                                "$toggle_name": "quit_button_custom",
                                "$toggle_view_binding_name": "quit_button_state"
                            }
                        }
                    ]
                }
            },
            //{
                //"exit_confim_modal": {
                    //"type": "image",
                    //"texture": "textures/ui/Black",
                    //"anchor_from": "top_middle",
                    //"anchor_to": "top_middle",
                    //"size": [64, 64],
                    //"offset": [0, 4],
                    //"bindings": [
                        //{
                            //"binding_type": "view",
                            //"source_control_name": "quit_button_custom",
                            //"source_property_name": "#quit_button_state",
                            //"target_property_name": "#visible"
                        //}
                    //]
                //}
            //}
        ]