本文整理汇总了Java中com.watabou.utils.Signal类的典型用法代码示例。如果您正苦于以下问题:Java Signal类的具体用法?Java Signal怎么用?Java Signal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Signal类属于com.watabou.utils包,在下文中一共展示了Signal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import com.watabou.utils.Signal; //导入依赖的package包/类
public void create() {
Keys.event.add(keyListener = new Signal.Listener<Keys.Key>() {
@Override
public void onSignal(Keys.Key key) {
if (Game.instance != null && key.pressed) {
switch (key.code) {
case Keys.BACK:
onBackPressed();
break;
case Keys.MENU:
onMenuPressed();
break;
}
}
}
});
}
示例2: create
import com.watabou.utils.Signal; //导入依赖的package包/类
public void create() {
Keys.event.add( keyListener = new Signal.Listener<Keys.Key>() {
@Override
public void onSignal( Keys.Key key ) {
if (Game.instance != null && key.pressed) {
switch (key.code) {
case Keys.BACK:
onBackPressed();
break;
case Keys.MENU:
onMenuPressed();
break;
}
}
}
} );
}
示例3: create
import com.watabou.utils.Signal; //导入依赖的package包/类
public void create() {
Gdx.input.setCatchBackKey(true);
Game.instance.getInputProcessor().addKeyListener(keyListener = new Signal.Listener<NoosaInputProcessor.Key>() {
@Override
public void onSignal(NoosaInputProcessor.Key key) {
if (Game.instance != null && key.pressed) {
switch (key.code) {
case Input.Keys.BACK:
case Input.Keys.ESCAPE:
onBackPressed();
break;
case Input.Keys.MENU:
case Input.Keys.F5:
onMenuPressed();
break;
}
}
}
});
}
示例4: create
import com.watabou.utils.Signal; //导入依赖的package包/类
public void create() {
Game.instance.getInputProcessor().addKeyListener(keyListener = new Signal.Listener<NoosaInputProcessor.Key>() {
@Override
public void onSignal(NoosaInputProcessor.Key key) {
if (Game.instance != null && key.pressed) {
switch (key.code) {
case Input.Keys.BACK:
case Input.Keys.ESCAPE:
onBackPressed();
break;
case Input.Keys.MENU:
case Input.Keys.F5:
onMenuPressed();
break;
}
}
}
});
}
示例5: create
import com.watabou.utils.Signal; //导入依赖的package包/类
public void create() {
Keys.event.add( keyListener = new Signal.Listener<Keys.Key>() {
@Override
public void onSignal( Keys.Key key ) {
if (Game.instance() != null && key.pressed) {
switch (key.code) {
case Keys.BACK:
onBackPressed();
break;
case Keys.MENU:
onMenuPressed();
break;
}
}
}
} );
}
示例6: create
import com.watabou.utils.Signal; //导入依赖的package包/类
public void create() {
Game.instance.getInputProcessor().addKeyListener(keyListener = new Signal.Listener<NoosaInputProcessor.Key>() {
@Override
public void onSignal(NoosaInputProcessor.Key key) {
if (Game.instance != null && key.pressed) {
switch (key.code) {
case Input.Keys.BACK:
case Input.Keys.ESCAPE:
onBackPressed();
break;
case Input.Keys.MENU:
case Input.Keys.F5:
onMenuPressed();
break;
}
}
}
});
}
示例7: addKeyListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void addKeyListener(Signal.Listener<Key<T>> listener) {
eventKey.add(listener);
}
示例8: removeKeyListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void removeKeyListener(Signal.Listener<Key<T>> listener) {
eventKey.remove(listener);
}
示例9: addTouchListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void addTouchListener(Signal.Listener<Touch> listener) {
eventTouch.add(listener);
}
示例10: removeTouchListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void removeTouchListener(Signal.Listener<Touch> listener) {
eventTouch.remove(listener);
}
示例11: addMouseListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void addMouseListener(Signal.Listener<PDMouseEvent> listener) {
eventMouse.add(listener);
}
示例12: removeMouseListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void removeMouseListener(Signal.Listener<PDMouseEvent> listener) {
eventMouse.remove(listener);
}
示例13: addKeyListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void addKeyListener(Signal.Listener<Key<T>> listener) {
eventKey.add(listener);
}
示例14: removeKeyListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void removeKeyListener(Signal.Listener<Key<T>> listener) {
eventKey.remove(listener);
}
示例15: addTouchListener
import com.watabou.utils.Signal; //导入依赖的package包/类
public void addTouchListener(Signal.Listener<Touch> listener) {
eventTouch.add(listener);
}