Example usage for com.badlogic.gdx.scenes.scene2d.ui Image getImageWidth

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Image getImageWidth

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui Image getImageWidth.

Prototype

public float getImageWidth() 

Source Link

Usage

From source file:com.forerunnergames.peril.client.ui.screens.game.play.modes.classic.dialogs.armymovement.AbstractArmyMovementDialog.java

License:Open Source License

private static float calculateCountryImagePadding(final Image countryImagePostLayout, final float arrowWidth) {
    return Math.max(0.0f, Math.min(arrowWidth, arrowWidth
            - (COUNTRY_BOX_WIDTH - COUNTRY_BOX_INNER_PADDING * 2.0f - countryImagePostLayout.getImageWidth())));
}

From source file:com.forerunnergames.peril.client.ui.screens.game.play.modes.classic.dialogs.armymovement.AbstractArmyMovementDialog.java

License:Open Source License

private Vector2 calculateCountryImageScaling(final Country country, final Image countryImagePostLayout) {
    return tempScaling.set(countryImagePostLayout.getImageWidth() / country.getReferenceWidth(),
            countryImagePostLayout.getImageHeight() / country.getReferenceHeight());
}

From source file:com.kotcrab.vis.ui.widget.color.internal.GridSubImage.java

License:Apache License

public void draw(Batch batch, Image parent) {
    ShaderProgram originalShader = batch.getShader();
    batch.setShader(gridShader);/*from  www  .  j a  va  2 s  .  c  om*/
    gridShader.setUniformf("u_width", parent.getWidth());
    gridShader.setUniformf("u_height", parent.getHeight());
    gridShader.setUniformf("u_gridSize", gridSize);
    batch.draw(whiteTexture, parent.getX() + parent.getImageX(), parent.getY() + parent.getImageY(),
            parent.getImageWidth() * parent.getScaleX(), parent.getImageHeight() * parent.getScaleY());
    batch.setShader(originalShader);
}