本文整理了Java中com.badlogic.gdx.scenes.scene2d.Actor.localToActorCoordinates()
方法的一些代码示例,展示了Actor.localToActorCoordinates()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Actor.localToActorCoordinates()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.Actor
类名称:Actor
方法名:localToActorCoordinates
[英]Converts coordinates for this actor to those of another actor, which can be anywhere in the stage.
[中]将此演员的坐标转换为其他演员的坐标,该坐标可以位于舞台的任何位置。
代码示例来源:origin: libgdx/libgdx
public void drag (InputEvent event, float x, float y, int pointer) {
event.getListenerActor().localToActorCoordinates(scroll, tmpCoords.set(x, y));
if (tmpCoords.y >= scroll.getHeight()) {
scrollDown.cancel();
if (!scrollUp.isScheduled()) {
startTime = System.currentTimeMillis();
Timer.schedule(scrollUp, tickSecs, tickSecs);
}
return;
} else if (tmpCoords.y < 0) {
scrollUp.cancel();
if (!scrollDown.isScheduled()) {
startTime = System.currentTimeMillis();
Timer.schedule(scrollDown, tickSecs, tickSecs);
}
return;
}
scrollUp.cancel();
scrollDown.cancel();
}
代码示例来源:origin: libgdx/libgdx
public void drag (InputEvent event, float x, float y, int pointer) {
event.getListenerActor().localToActorCoordinates(scroll, tmpCoords.set(x, y));
if (tmpCoords.y >= scroll.getHeight()) {
scrollDown.cancel();
if (!scrollUp.isScheduled()) {
startTime = System.currentTimeMillis();
Timer.schedule(scrollUp, tickSecs, tickSecs);
}
return;
} else if (tmpCoords.y < 0) {
scrollUp.cancel();
if (!scrollDown.isScheduled()) {
startTime = System.currentTimeMillis();
Timer.schedule(scrollDown, tickSecs, tickSecs);
}
return;
}
scrollUp.cancel();
scrollDown.cancel();
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
public void drag (InputEvent event, float x, float y, int pointer) {
event.getListenerActor().localToActorCoordinates(scroll, tmpCoords.set(x, y));
if (tmpCoords.x >= 0 && tmpCoords.x < scroll.getWidth()) {
if (tmpCoords.y >= scroll.getHeight()) {
scrollDown.cancel();
if (!scrollUp.isScheduled()) {
startTime = System.currentTimeMillis();
Timer.schedule(scrollUp, tickSecs, tickSecs);
}
return;
} else if (tmpCoords.y < 0) {
scrollUp.cancel();
if (!scrollDown.isScheduled()) {
startTime = System.currentTimeMillis();
Timer.schedule(scrollDown, tickSecs, tickSecs);
}
return;
}
}
scrollUp.cancel();
scrollDown.cancel();
}
内容来源于网络,如有侵权,请联系作者删除!