为什么touchDragged
只能在桌面上运行,不适用于Android设备?
buttons[row][col].addListener(new DragListener() {
@Override
public void touchDragged(InputEvent event, float x, float y, int pointer) {
for (int row = 0; row < buttons.length; row++) {
for (int col = 0; col < buttons[0].length; col++) {
if (buttons[row][col].isOver()) {
buttons[row][col].setColor(Color.GREEN);
}
}
}
}
});
Gdx.input.setInputProcessor(stage);