本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Button.getHeight()
方法的一些代码示例,展示了Button.getHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.getHeight()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Button
类名称:Button
方法名:getHeight
暂无
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
this.x = viewportWidth - distance - buttons[0].getWidth() / 2 - margin;
if(y < distance + buttons[0].getHeight() / 2 + margin)
this.y = distance + buttons[0].getHeight() / 2 + margin;
else if(y > viewportHeight - distance - buttons[0].getHeight() / 2 - margin)
this.y = viewportHeight - distance - buttons[0].getHeight() / 2 - margin;
endPositions[i].y = (float)(Math.sin(Math.toRadians(angle))) * distance + this.y;
buttons[i].setPosition(this.x - buttons[i].getWidth() / 2, this.y - buttons[i].getHeight() / 2);
buttons[i].addAction(Actions
.moveTo(endPositions[i].x - buttons[i].getWidth() / 2, endPositions[i].y - buttons[i].getWidth() / 2, .1f));
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
else if (y > viewportHeight - lookatButton.getHeight() - margin)
this.y = viewportHeight - lookatButton.getHeight() - margin;
lookatButton.setPosition(this.x - lookatButton.getWidth() / 2, this.y - lookatButton.getHeight() / 2);
lookatButton.addAction(Actions.moveTo(this.x - lookatButton.getWidth() - margin / 2, this.y + margin, .1f));
rightButton.setPosition(this.x - lookatButton.getWidth() / 2, this.y - lookatButton.getHeight() / 2);
rightButton.addAction(Actions.moveTo(this.x + margin / 2, this.y + margin, .1f));
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
@Override
public void resize(int width, int height) {
final World world = ui.getWorld();
if (!world.isDisposed()) {
screenViewport.setWorldSize(world.getWidth(), world.getHeight());
screenViewport.update(width, height, true);
worldViewport.setScreenBounds(screenViewport.getScreenX(), screenViewport.getScreenY(),
screenViewport.getScreenWidth(), screenViewport.getScreenHeight());
world.resize(screenViewport.getWorldWidth(), screenViewport.getWorldHeight());
}
pointer.resize();
verbUI.setSize(screenViewport.getScreenWidth(), screenViewport.getScreenHeight() * UI_SCREEN_PERCENT);
float size = DPIUtils.getPrefButtonSize();
float margin = DPIUtils.getMarginSize();
menuButton.setSize(size, size);
menuButton.setPosition(stage.getViewport().getScreenWidth() - menuButton.getWidth() - margin,
stage.getViewport().getScreenHeight() - menuButton.getHeight() - margin);
}
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
@Override
public void resize(int width, int height) {
final World world = ui.getWorld();
if (!world.isDisposed()) {
viewport.setWorldSize(world.getWidth(), world.getHeight());
viewport.update(width, height, true);
world.resize(viewport.getWorldWidth(), viewport.getWorldHeight());
} else {
viewport.setWorldSize(width, height);
viewport.update(width, height, true);
}
updateUI();
pie.resize(viewport.getScreenWidth(), viewport.getScreenHeight());
inventoryUI.resize(viewport.getScreenWidth(), viewport.getScreenHeight());
inventoryButton.resize(width, height);
pointer.resize(width, height);
float size = DPIUtils.getPrefButtonSize();
float margin = DPIUtils.getMarginSize();
menuButton.setSize(size, size);
menuButton.setPosition(stage.getViewport().getScreenWidth() - menuButton.getWidth() - margin,
stage.getViewport().getScreenHeight() - menuButton.getHeight() - margin);
}
代码示例来源:origin: xietansheng/Game2048ForGDX
setSize(getMainGame().getWorldWidth(), helpButton.getHeight());
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
menuButton.setPosition(getWidth() - menuButton.getWidth() / 2, (getHeight() - menuButton.getHeight()) / 2);
float iconSize = DPIUtils.getPrefButtonSize();
代码示例来源:origin: xietansheng/Game2048ForGDX
msgLabel.setY(okButton.getY() + okButton.getHeight() + 50);
addActor(msgLabel);
代码示例来源:origin: dsaltares/libgdx-cookbook
buttonStyle.up = new TextureRegionDrawable(new TextureRegion(actor));
button = new Button(buttonStyle);
button.setPosition(75, firstRowY-button.getHeight());
button.addListener( new ClickListener() {
@Override
内容来源于网络,如有侵权,请联系作者删除!