• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Shin-NiL/Godot-Mobile-Vibration: Mobile vibration module for Godot Game Engine

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Shin-NiL/Godot-Mobile-Vibration

开源软件地址:

https://github.com/Shin-NiL/Godot-Mobile-Vibration

开源编程语言:

Java 42.6%

开源软件介绍:

Donate

Godot Mobile Vibration

This is a vibration module for Godot Game Engine 3 for Android & iOS (need testing).

How to use

Android

To use this module you'll need a custom template for Android. You can build it by yourself or download a precompiled one.

Compiling the template (First Option)

This is harder, but you'll have more control over the building process. You can, for example, include any other module you want. For that, do the following steps:

  • Clone or download this repository.
  • Clone or download the Godot Engine repository. One important note here is that this must match the same version of the Godot editor you're using to develop your game.
  • Drop the "vibration" directory inside the "modules" directory on the Godot source.
  • Recompile the android export template following the official instructions.

Using precompiled templates (Second Option)

If you don't want or can't build the template by yourself, you can find a precompiled template with this module here. Go to the release tab and download the zip file.

Project configuration

  • In your project goto Export > Target > Android:
    • Options:
      • Custom Package:
        • place the template apk you had compiled (or downloaded)
  • On the Android export options, check the Vibrate permission
  • Add the following lines to project.godot:
[android]
modules="org/godotengine/godot/Vibration"

If you have more than one module separate them by comma.

iOS

  • Drop the "vibration" directory inside the "modules" directory on the Godot source;
  • Recompile the iOS export template following the official instructions.
  • For exporting, follow the exporting to iOS official documentation.
  • Export your project from Godot, it'll create an Xcode project;
  • Copy the library (.a) you have compiled following the official documentation inside the exported Xcode project. You must override the 'your_project_name.a' file with this file.

API Reference (Android & iOS)

The following methods are available:

# Make the device vibrates
# @param int duration the vibration duration in milliseconds (this parameter is ignored on iOS)
vibrate(duration)

Demo

In the demo directory you'll find a working sample project for Godot 3.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap