本文整理了Java中com.badlogic.gdx.Input.vibrate()
方法的一些代码示例,展示了Input.vibrate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Input.vibrate()
方法的具体详情如下:
包路径:com.badlogic.gdx.Input
类名称:Input
方法名:vibrate
[英]Vibrates for the given amount of time. Note that you'll need the permission in your manifest file in order for this to work. [中]在给定的时间内振动。请注意,您需要在清单文件中具有权限
,才能使其正常工作。
代码示例来源:origin: libgdx/libgdx
@Override
public void vibrate (int milliseconds) {
input.vibrate(milliseconds);
}
代码示例来源:origin: libgdx/libgdx
@Override
public void vibrate (long[] pattern, int repeat) {
input.vibrate(pattern, repeat);
}
代码示例来源:origin: libgdx/libgdx
@Override
public void render () {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
font.draw(batch, "Touch screen to vibrate", 100, 100);
batch.end();
if (Gdx.input.justTouched()) Gdx.input.vibrate(100);
}
}
代码示例来源:origin: 00-Evan/shattered-pixel-dungeon-gdx
public static void vibrate( int milliseconds ) {
Gdx.input.vibrate(milliseconds);
}
代码示例来源:origin: moribitotech/MTX
/**
* Vibrate, it only vibrates if SettingsManager.isVibrationOn(), 1000ms is 1
* second, also requires "android.permission.VIBRATE" in android manifest
* */
public void vibrate(int milliseconds) {
if (SettingsManager.isVibrationOn()) {
Gdx.input.vibrate(milliseconds);
}
}
代码示例来源:origin: moribitotech/MTX
/**
* Vibrate with a pattern, it only vibrates if
* SettingsManager.isVibrationOn(), 1000ms is 1 second, also requires
* "android.permission.VIBRATE" in android manifest
* */
public void vibrate(long[] pattern, int repeat) {
if (SettingsManager.isVibrationOn()) {
Gdx.input.vibrate(pattern, repeat);
}
}
内容来源于网络,如有侵权,请联系作者删除!