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

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

Introduction

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

Prototype

public float getImageX() 

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 Vector2 calculateCountryArmyTextCircleTopLeftActualCountrySpace(final Country country,
        final Image countryImagePostLayout) {
    return tempPosition.set(country.getReferenceTextUpperLeft()).sub(country.getReferenceDestination())
            .set(Math.abs(tempPosition.x), Math.abs(tempPosition.y))
            .scl(calculateCountryImageScaling(country, countryImagePostLayout))
            .add(countryImagePostLayout.getImageX(), countryImagePostLayout.getImageY());
}

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);/*ww w.j a  v  a  2s  . com*/
    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);
}