本文整理汇总了Java中com.badlogic.gdx.controllers.ControllerListener类的典型用法代码示例。如果您正苦于以下问题:Java ControllerListener类的具体用法?Java ControllerListener怎么用?Java ControllerListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ControllerListener类属于com.badlogic.gdx.controllers包,在下文中一共展示了ControllerListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BufferBciController
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
/**
* Initializes the BufferBciController instance.
*/
public BufferBciController() {
this.buttons = new ArrayList<BufferBciButton>();
this.axes = new ArrayList<BufferBciAxis>();
this.controllerListeners = new ArrayList<ControllerListener>();
this.unprocessedEvents = new ArrayList<BufferEvent>();
}
示例2: onButtonUpdated
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
/**
* Called whenever a button is updated.
* @param btn
*/
private void onButtonUpdated(BufferBciButton btn) {
// Inform listeners.
for (ControllerListener cl : controllerListeners) {
if (btn.activated) {
cl.buttonDown(this, btn.code);
} else {
cl.buttonUp(this, btn.code);
}
}
}
示例3: onAxisUpdated
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
/**
* Called whenever an axis is updated.
* @param axis
*/
protected void onAxisUpdated(BufferBciAxis axis)
{
// Inform listeners.
for (ControllerListener cl : controllerListeners) {
cl.axisMoved(this, axis.code, axis.value);
}
}
示例4: addListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void addListener(ControllerListener listener) {
listeners.add(listener);
}
示例5: removeListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void removeListener(ControllerListener listener) {
listeners.removeValue(listener, true);
}
示例6: addListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void addListener(ControllerListener listener) {
this.listeners.add(listener);
}
示例7: removeListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void removeListener(ControllerListener listener) {
this.listeners.removeValue(listener, true);
}
示例8: getListeners
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
public Array<ControllerListener> getListeners() {
return listeners;
}
示例9: addListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void addListener (ControllerListener listener) {
synchronized(eventQueue) {
listeners.add(listener);
}
}
示例10: removeListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void removeListener (ControllerListener listener) {
synchronized(eventQueue) {
listeners.removeValue(listener, true);
}
}
示例11: addListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void addListener (ControllerListener listener) {
this.listeners.add(listener);
}
示例12: removeListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void removeListener (ControllerListener listener) {
this.listeners.removeValue(listener, true);
}
示例13: getListeners
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
public Array<ControllerListener> getListeners() {
return this.listeners;
}
示例14: addListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void addListener(ControllerListener listener) {
this.listeners.add(listener);
}
示例15: removeListener
import com.badlogic.gdx.controllers.ControllerListener; //导入依赖的package包/类
@Override
public void removeListener(ControllerListener listener) {
this.listeners.removeValue(listener, true);
}