Unity3d 新用户界面 : How to set button's interactable zone bigger than the attached image?

标签 unity3d

我需要它,因为 image很小,很难在移动设备上触摸它。所以我需要有更大的可交互区域,但 image应该保持小。

最佳答案

我相信制作这样的按钮最合适的方法是这样的:

  • 创建一个新的 Button,删除默认的子 Text。
  • 套装WidthHeight按钮,因为您需要命中区域大小。
  • 添加 Vertical Layout Group按钮的组件。
  • 套装PaddingVertical Layout Group命中区域和视觉效果之间的理想差异。
  • 删除默认值 Image组件。设置默认的 alpha Image分量为零。
  • 将您的图像作为 Button 的 child 。
  • 修复色调:拖动(或以其他方式设置)子项 ImageTarget Graphic领域Button .
  • 关于Unity3d 新用户界面 : How to set button's interactable zone bigger than the attached image?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28914474/

    相关文章:

    c++ - 用户定义的结构/类计算

    android - Facebook Analytics for Apps 中未跟踪 Android 上的 Unity 游戏 Activity 安装

    android - Unity SignReleaseBundle失败

    unity3d - 开始使用纯 ECS

    c# - 为什么 Unity 会忽略非静态公共(public)字段的初始化值?

    windows - 如何限制 GPU 和 CPU 的使用以进行兼容性测试?

    c# - 在 Unity3D 中使用 Windows.Networking.Sockets

    c# - 从统一游戏对象获取高度/宽度

    android - 无法使用 Unity 插件中的 android jar 中的 context.getClassLoader.getResaurceAsStream 访问图像

    Unity3d 中的 Android webview (C#)