本文整理了Java中com.badlogic.gdx.Input.getCurrentEventTime()
方法的一些代码示例,展示了Input.getCurrentEventTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Input.getCurrentEventTime()
方法的具体详情如下:
包路径:com.badlogic.gdx.Input
类名称:Input
方法名:getCurrentEventTime
暂无
代码示例来源:origin: libgdx/libgdx
@Override
public long getCurrentEventTime () {
return input.getCurrentEventTime();
}
代码示例来源:origin: libgdx/libgdx
tracker.start(pointer2.x, pointer2.y, Gdx.input.getCurrentEventTime());
} else {
tracker.start(pointer1.x, pointer1.y, Gdx.input.getCurrentEventTime());
long time = Gdx.input.getCurrentEventTime();
if (time - tracker.lastTime < maxFlingDelay) {
tracker.update(x, y, time);
代码示例来源:origin: libgdx/libgdx
tracker.start(pointer2.x, pointer2.y, Gdx.input.getCurrentEventTime());
} else {
tracker.start(pointer1.x, pointer1.y, Gdx.input.getCurrentEventTime());
long time = Gdx.input.getCurrentEventTime();
if (time - tracker.lastTime < maxFlingDelay) {
tracker.update(x, y, time);
代码示例来源:origin: libgdx/libgdx
public boolean touchDragged (float x, float y, int pointer) {
if (pointer > 1) return false;
if (longPressFired) return false;
if (pointer == 0)
pointer1.set(x, y);
else
pointer2.set(x, y);
// handle pinch zoom
if (pinching) {
if (listener != null) {
boolean result = listener.pinch(initialPointer1, initialPointer2, pointer1, pointer2);
return listener.zoom(initialPointer1.dst(initialPointer2), pointer1.dst(pointer2)) || result;
}
return false;
}
// update tracker
tracker.update(x, y, Gdx.input.getCurrentEventTime());
// check if we are still tapping.
if (inTapRectangle && !isWithinTapRectangle(x, y, tapRectangleCenterX, tapRectangleCenterY)) {
longPressTask.cancel();
inTapRectangle = false;
}
// if we have left the tap square, we are panning
if (!inTapRectangle) {
panning = true;
return listener.pan(x, y, tracker.deltaX, tracker.deltaY);
}
return false;
}
代码示例来源:origin: libgdx/libgdx
public boolean touchDragged (float x, float y, int pointer) {
if (pointer > 1) return false;
if (longPressFired) return false;
if (pointer == 0)
pointer1.set(x, y);
else
pointer2.set(x, y);
// handle pinch zoom
if (pinching) {
if (listener != null) {
boolean result = listener.pinch(initialPointer1, initialPointer2, pointer1, pointer2);
return listener.zoom(initialPointer1.dst(initialPointer2), pointer1.dst(pointer2)) || result;
}
return false;
}
// update tracker
tracker.update(x, y, Gdx.input.getCurrentEventTime());
// check if we are still tapping.
if (inTapRectangle && !isWithinTapRectangle(x, y, tapRectangleCenterX, tapRectangleCenterY)) {
longPressTask.cancel();
inTapRectangle = false;
}
// if we have left the tap square, we are panning
if (!inTapRectangle) {
panning = true;
return listener.pan(x, y, tracker.deltaX, tracker.deltaY);
}
return false;
}
代码示例来源:origin: libgdx/libgdx
gestureStartTime = Gdx.input.getCurrentEventTime();
tracker.start(x, y, gestureStartTime);
if (Gdx.input.isTouched(1)) {
代码示例来源:origin: libgdx/libgdx
gestureStartTime = Gdx.input.getCurrentEventTime();
tracker.start(x, y, gestureStartTime);
if (Gdx.input.isTouched(1)) {
代码示例来源:origin: org.mapsforge/vtm-gdx
@Override
public boolean scrolled(int amount) {
mTime = Gdx.input.getCurrentEventTime();
return false;
}
代码示例来源:origin: org.mapsforge/vtm-gdx
@Override
public boolean mouseMoved(int screenX, int screenY) {
mTime = Gdx.input.getCurrentEventTime();
mType = MotionEvent.ACTION_MOVE;
mPointerX[Buttons.LEFT] = mCurX = screenX;
mPointerY[Buttons.LEFT] = mCurY = screenY;
mPointer = Buttons.LEFT;
//GdxMap.log.debug("moved " + screenX + ":" + screenY);
mMap.input.fire(null, this);
return true;
}
代码示例来源:origin: org.mapsforge/vtm-gdx
@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
if (pointer >= 10)
return true;
mTime = Gdx.input.getCurrentEventTime();
mType = MotionEvent.ACTION_MOVE;
mPointerX[pointer] = mCurX = screenX;
mPointerY[pointer] = mCurY = screenY;
mPointer = pointer;
//GdxMap.log.debug("dragged " + screenX + ":" + screenY
// + " / " + pointer + " " + (getTime() - mDownTime));
mMap.input.fire(null, this);
return true;
}
代码示例来源:origin: org.mapsforge/vtm-gdx
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
if (pointer >= 10)
return true;
if (button != Buttons.LEFT)
return false;
if (mPointerDown == 0)
return true;
mTime = Gdx.input.getCurrentEventTime();
mType = (--mPointerDown == 0) ?
MotionEvent.ACTION_UP :
MotionEvent.ACTION_POINTER_UP;
mPointerX[pointer] = mCurX = screenX;
mPointerY[pointer] = mCurY = screenY;
mPointer = pointer;
//GdxMap.log.debug("up " + screenX + ":" + screenY
// + " / " + pointer + " " + mPointerDown
// + " " + (getTime() - mDownTime));
mMap.input.fire(null, this);
return true;
}
代码示例来源:origin: org.mapsforge/vtm-gdx
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
if (pointer >= 10)
return true;
if (button != Buttons.LEFT)
return false;
mTime = Gdx.input.getCurrentEventTime();
if (mPointerDown++ == 0) {
mDownTime = getTime();
mType = MotionEvent.ACTION_DOWN;
} else {
mType = MotionEvent.ACTION_POINTER_DOWN;
}
mPointerX[pointer] = mCurX = screenX;
mPointerY[pointer] = mCurY = screenY;
mPointer = pointer;
//GdxMap.log.debug("down " + screenX + ":" + screenY
// + " / " + pointer + " " + mPointerDown
// + " " + (getTime() - mDownTime));
mMap.input.fire(null, this);
return true;
}
代码示例来源:origin: crashinvaders/gdx-texture-packer-gui
@Override
public void clicked(final InputEvent event, final float x, final float y) {
long currentEventTime = Gdx.input.getCurrentEventTime();
long deltaTime = currentEventTime - lastClickTime;
lastClickTime = currentEventTime;
if (!firstClickCaught) {
firstClickCaught = true;
} else {
if (deltaTime < SECOND_CLICK_TIME) {
firstClickCaught = false;
tmpParams.actor = actor;
tmpParams.x = x;
tmpParams.y = y;
tmpParams.stageX = event.getStageX();
tmpParams.stageY = event.getStageY();
action.consume(tmpParams);
tmpParams.reset();
}
}
}
});
代码示例来源:origin: com.badlogicgames.gdx/gdx
tracker.start(pointer2.x, pointer2.y, Gdx.input.getCurrentEventTime());
} else {
tracker.start(pointer1.x, pointer1.y, Gdx.input.getCurrentEventTime());
long time = Gdx.input.getCurrentEventTime();
if (time - tracker.lastTime < maxFlingDelay) {
tracker.update(x, y, time);
代码示例来源:origin: com.badlogicgames.gdx/gdx
public boolean touchDragged (float x, float y, int pointer) {
if (pointer > 1) return false;
if (longPressFired) return false;
if (pointer == 0)
pointer1.set(x, y);
else
pointer2.set(x, y);
// handle pinch zoom
if (pinching) {
if (listener != null) {
boolean result = listener.pinch(initialPointer1, initialPointer2, pointer1, pointer2);
return listener.zoom(initialPointer1.dst(initialPointer2), pointer1.dst(pointer2)) || result;
}
return false;
}
// update tracker
tracker.update(x, y, Gdx.input.getCurrentEventTime());
// check if we are still tapping.
if (inTapRectangle && !isWithinTapRectangle(x, y, tapRectangleCenterX, tapRectangleCenterY)) {
longPressTask.cancel();
inTapRectangle = false;
}
// if we have left the tap square, we are panning
if (!inTapRectangle) {
panning = true;
return listener.pan(x, y, tracker.deltaX, tracker.deltaY);
}
return false;
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
gestureStartTime = Gdx.input.getCurrentEventTime();
tracker.start(x, y, gestureStartTime);
if (Gdx.input.isTouched(1)) {
内容来源于网络,如有侵权,请联系作者删除!