- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Window.getY()
方法的一些代码示例,展示了Window.getY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.getY()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Window
类名称:Window
方法名:getY
暂无
代码示例来源:origin: libgdx/libgdx
public void draw (Batch batch, float parentAlpha) {
Stage stage = getStage();
if (stage.getKeyboardFocus() == null) stage.setKeyboardFocus(this);
keepWithinStage();
if (style.stageBackground != null) {
stageToLocalCoordinates(tmpPosition.set(0, 0));
stageToLocalCoordinates(tmpSize.set(stage.getWidth(), stage.getHeight()));
drawStageBackground(batch, parentAlpha, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x,
getY() + tmpSize.y);
}
super.draw(batch, parentAlpha);
}
代码示例来源:origin: libgdx/libgdx
public void draw (Batch batch, float parentAlpha) {
Stage stage = getStage();
if (stage.getKeyboardFocus() == null) stage.setKeyboardFocus(this);
keepWithinStage();
if (style.stageBackground != null) {
stageToLocalCoordinates(tmpPosition.set(0, 0));
stageToLocalCoordinates(tmpSize.set(stage.getWidth(), stage.getHeight()));
drawStageBackground(batch, parentAlpha, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x,
getY() + tmpSize.y);
}
super.draw(batch, parentAlpha);
}
代码示例来源:origin: libgdx/libgdx
public void keepWithinStage () {
if (!keepWithinStage) return;
Stage stage = getStage();
if (stage == null) return;
Camera camera = stage.getCamera();
if (camera instanceof OrthographicCamera) {
OrthographicCamera orthographicCamera = (OrthographicCamera)camera;
float parentWidth = stage.getWidth();
float parentHeight = stage.getHeight();
if (getX(Align.right) - camera.position.x > parentWidth / 2 / orthographicCamera.zoom)
setPosition(camera.position.x + parentWidth / 2 / orthographicCamera.zoom, getY(Align.right), Align.right);
if (getX(Align.left) - camera.position.x < -parentWidth / 2 / orthographicCamera.zoom)
setPosition(camera.position.x - parentWidth / 2 / orthographicCamera.zoom, getY(Align.left), Align.left);
if (getY(Align.top) - camera.position.y > parentHeight / 2 / orthographicCamera.zoom)
setPosition(getX(Align.top), camera.position.y + parentHeight / 2 / orthographicCamera.zoom, Align.top);
if (getY(Align.bottom) - camera.position.y < -parentHeight / 2 / orthographicCamera.zoom)
setPosition(getX(Align.bottom), camera.position.y - parentHeight / 2 / orthographicCamera.zoom, Align.bottom);
} else if (getParent() == stage.getRoot()) {
float parentWidth = stage.getWidth();
float parentHeight = stage.getHeight();
if (getX() < 0) setX(0);
if (getRight() > parentWidth) setX(parentWidth - getWidth());
if (getY() < 0) setY(0);
if (getTop() > parentHeight) setY(parentHeight - getHeight());
}
}
代码示例来源:origin: libgdx/libgdx
public void keepWithinStage () {
if (!keepWithinStage) return;
Stage stage = getStage();
if (stage == null) return;
Camera camera = stage.getCamera();
if (camera instanceof OrthographicCamera) {
OrthographicCamera orthographicCamera = (OrthographicCamera)camera;
float parentWidth = stage.getWidth();
float parentHeight = stage.getHeight();
if (getX(Align.right) - camera.position.x > parentWidth / 2 / orthographicCamera.zoom)
setPosition(camera.position.x + parentWidth / 2 / orthographicCamera.zoom, getY(Align.right), Align.right);
if (getX(Align.left) - camera.position.x < -parentWidth / 2 / orthographicCamera.zoom)
setPosition(camera.position.x - parentWidth / 2 / orthographicCamera.zoom, getY(Align.left), Align.left);
if (getY(Align.top) - camera.position.y > parentHeight / 2 / orthographicCamera.zoom)
setPosition(getX(Align.top), camera.position.y + parentHeight / 2 / orthographicCamera.zoom, Align.top);
if (getY(Align.bottom) - camera.position.y < -parentHeight / 2 / orthographicCamera.zoom)
setPosition(getX(Align.bottom), camera.position.y - parentHeight / 2 / orthographicCamera.zoom, Align.bottom);
} else if (getParent() == stage.getRoot()) {
float parentWidth = stage.getWidth();
float parentHeight = stage.getHeight();
if (getX() < 0) setX(0);
if (getRight() > parentWidth) setX(parentWidth - getWidth());
if (getY() < 0) setY(0);
if (getTop() > parentHeight) setY(parentHeight - getHeight());
}
}
代码示例来源:origin: libgdx/libgdx
public void touchDragged (InputEvent event, float x, float y, int pointer) {
if (!dragging) return;
float width = getWidth(), height = getHeight();
float windowX = getX(), windowY = getY();
代码示例来源:origin: libgdx/libgdx
public void touchDragged (InputEvent event, float x, float y, int pointer) {
if (!dragging) return;
float width = getWidth(), height = getHeight();
float windowX = getX(), windowY = getY();
代码示例来源:origin: com.badlogicgames.gdx/gdx
public void draw (Batch batch, float parentAlpha) {
Stage stage = getStage();
if (stage.getKeyboardFocus() == null) stage.setKeyboardFocus(this);
keepWithinStage();
if (style.stageBackground != null) {
stageToLocalCoordinates(tmpPosition.set(0, 0));
stageToLocalCoordinates(tmpSize.set(stage.getWidth(), stage.getHeight()));
drawStageBackground(batch, parentAlpha, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x,
getY() + tmpSize.y);
}
super.draw(batch, parentAlpha);
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
public void keepWithinStage () {
if (!keepWithinStage) return;
Stage stage = getStage();
if (stage == null) return;
Camera camera = stage.getCamera();
if (camera instanceof OrthographicCamera) {
OrthographicCamera orthographicCamera = (OrthographicCamera)camera;
float parentWidth = stage.getWidth();
float parentHeight = stage.getHeight();
if (getX(Align.right) - camera.position.x > parentWidth / 2 / orthographicCamera.zoom)
setPosition(camera.position.x + parentWidth / 2 / orthographicCamera.zoom, getY(Align.right), Align.right);
if (getX(Align.left) - camera.position.x < -parentWidth / 2 / orthographicCamera.zoom)
setPosition(camera.position.x - parentWidth / 2 / orthographicCamera.zoom, getY(Align.left), Align.left);
if (getY(Align.top) - camera.position.y > parentHeight / 2 / orthographicCamera.zoom)
setPosition(getX(Align.top), camera.position.y + parentHeight / 2 / orthographicCamera.zoom, Align.top);
if (getY(Align.bottom) - camera.position.y < -parentHeight / 2 / orthographicCamera.zoom)
setPosition(getX(Align.bottom), camera.position.y - parentHeight / 2 / orthographicCamera.zoom, Align.bottom);
} else if (getParent() == stage.getRoot()) {
float parentWidth = stage.getWidth();
float parentHeight = stage.getHeight();
if (getX() < 0) setX(0);
if (getRight() > parentWidth) setX(parentWidth - getWidth());
if (getY() < 0) setY(0);
if (getTop() > parentHeight) setY(parentHeight - getHeight());
}
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
public void touchDragged (InputEvent event, float x, float y, int pointer) {
if (!dragging) return;
float width = getWidth(), height = getHeight();
float windowX = getX(), windowY = getY();
我正在尝试计算 WriteHTMLCell 框的高度。我想我可以使用调用 WriteHTMLCell() 前后 Y 位置之间的差异.... $start_y = $pdf->GetY(); $p
当我按窗口左上角附近的某个位置时,由于某种原因,输出结果为 e.getY()比 e.getX() 高约 40 。我不明白为什么...你呢?我对 e.getY() 不太清楚. //BBDemo.java
这是一个很长的问题。我已尽力使其更加简洁,但我认为您需要所有信息来提供帮助。 总结如下:我正在 try catch 连续点击作为端点。我将在这些点之间绘制 line2D 对象。我有一个监听器,它将点击
我在 JFrame 中嵌入了一个 JPanel。 JPanel被添加到BorderLayout的CENTER。我正在使用以下代码对其进行绘制,但 MouseEvent 的 getX() 和 getY(
我在 LibGDX 中遇到一个问题,当我调用 Gdx.input.getY() 时,它会选择一个位于应用程序相对于屏幕中心另一侧的像素。 public class Main extends Appli
好吧,我没什么可说的,但基本上我有一个 Player 类,然后在 GFX 类中我用它绘制 Player他的 getX() 和 getY() 所以 player.getX() 正如你所看到的,我制作了
这个问题在这里已经有了答案: Android ACTION_MOVE Threshold (3 个答案) 关闭 8 年前。 当读取一系列 onTouch 事件的 getX() 和 getY() 值时
我试图通过 onClickListener() 使一个 ImageView 移动到另一个 ImageView 的相同位置,我可以返回 x 但不能返回 y。 我要复制的 View 位置在 xml 中是不
GUI 组件的位置、宽度和高度何时设置?如果使用布局管理器,这些字段会受到怎样的影响?我有一个包含两个 slider 的面板,我想在其中一个 slider 旁边绘制一个矩形。下面是我的代码,用于初始化
在我解释文档时,getY()应该返回矩形的左上角 Y 坐标;即最大的Y坐标。但是,当调用 getMaxY() (继承自 RectangularShape 类)我得到了一个更大的值! 在代码中: Pat
我似乎不太了解 android View 中 getTop() 和 getY() 之间的区别。它们有何不同? 最佳答案 getTop() 返回相对于父级的 y 坐标。 getY() 像 getTop(
我正在尝试制作一个简单的应用程序,以便更好地了解如何在 Android 上使用触摸事件。现在,我的 Activity 只是将 ImageView 移动到屏幕上触摸的坐标(MotionEvent 的坐标
我需要帮助来理解以下内容。 假设我有一个 854x480 像素的显示器。为什么 MotionEvent.getX 和 getY 方法返回 float ?据我所知,显示器上的像素是离散整数,显示器上没有
有很多关于 MotionEvent.getX/.getY 如何“不可靠”(或其他术语)以及我们应该使用这些调用的原始版本来获取坐标的讨论。 在我的 Nexus 7 上,我发现 .getX/.getY
我有两个 ImageView。我想将一个移动到另一个之上。 当我尝试检索 ImageView 位置之一的值以将另一个移动到它时,我在 x 和 y 上都得到 0。 我尝试使用 getLeft/getTo
我正在编写一个基本的绘画程序,但我在 Rectangle 方面遇到了麻烦。和Ellipse工具。如果单击并拖动,您应该能够根据 startpoint 绘制尺寸的形状。和endpoint (都使用 ge
这是一项更大的家庭作业。如何使用 getX() 和 getY() 绘制一条线?这是我的代码,请帮忙。 package shapes; import java.awt.Color; import jav
我正在尝试创建一种方法来计算两个 Point 对象之间的距离: public class Point { private double x; private double y;
我有以下情况: 我有一个带有 ImageView 和 TextView 的自定义 ListView。ImageView 有一个 onTouchListener,它调用我的 onTouch 方法。以下是
本文整理了Java中us.ihmc.yoVariables.variable.YoFrameVector3D.getY()方法的一些代码示例,展示了YoFrameVector3D.getY()的具体用
我是一名优秀的程序员,十分优秀!