示例#1
0
    private void CreateExitButton()
    {
        var exitButton = new WidgetButton(_uiParams.CharUiMainExitButton);

        exitButton.SetAutoSizeHeight(false);
        exitButton.SetAutoSizeWidth(false);
        exitButton.SetStyle(new WidgetButtonStyle
        {
            DisabledImagePath = _uiParams.TexturePaths[CharUiTexture.MainExitButtonDisabled],
            HoverImagePath    = _uiParams.TexturePaths[CharUiTexture.MainExitButtonHoverOn],
            NormalImagePath   = _uiParams.TexturePaths[CharUiTexture.MainExitButtonHoverOff],
            PressedImagePath  = _uiParams.TexturePaths[CharUiTexture.MainExitButtonHoverPressed]
        });
        exitButton.SetClickHandler(ExitClicked);
        _mainWidget.Add(exitButton);
    }