Coder Social home page Coder Social logo

opensourcegamedeveloper / def_taptic_engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maratgilyazov/def_taptic_engine

0.0 1.0 0.0 105 KB

Native extension for Defold with Taptic Engine implementation for iOS

License: MIT License

C++ 43.97% C 7.48% Objective-C++ 48.55%

def_taptic_engine's Introduction

TapticEngine

This is a small native extension for Defold engine which allows to use iOS Taptic Engine.

Installation

You can use the DefTapticEngine extension in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:

https://github.com/MaratGilyazov/def_taptic_engine/archive/master.zip

Example

if (taptic_engine and taptic_engine.isSupported()) then
  
  taptic_engine.impact(taptic_engine.IMPACT_LIGHT)
  taptic_engine.impact(taptic_engine.IMPACT_MEDIUM)
  taptic_engine.impact(taptic_engine.IMPACT_HEAVY)
  
  taptic_engine.notification(taptic_engine.NOTIFICATION_SUCCESS)
  taptic_engine.notification(taptic_engine.NOTIFICATION_WARNING)
  taptic_engine.notification(taptic_engine.NOTIFICATION_ERROR)
  
  taptic_engine.selection()

else
  --do something else
end

LUA Api

taptic_engine.isSupported()

Returns bool flag saying if taptic engine is supprorted

taptic_engine.impact(int style)

Call Taptic Engine Impact feedback with given style - one of 3 constants: taptic_engine.IMPACT_LIGHT, taptic_engine.IMPACT_MEDIUM, taptic_engine.IMPACT_HEAVY

taptic_engine.notification(int type)

Call Taptic Engine Notification feedback with given type - one of 3 constants: taptic_engine.NOTIFICATION_SUCCESS, taptic_engine.NOTIFICATION_WARNING, taptic_engine.NOTIFICATION_ERROR

taptic_engine.selection()

Call Taptic Engine Selection feedback

Notes

prepare()

There is API to "prepare" taptic engine for further feedback calls, in actual implementation it's called once on first call to any of taptic_engine methods and there is no way to controll it manually

iOS part is based on iOS TAPTIC Engine Bridge for Unity by Koki Ibukuro

def_taptic_engine's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.