Java 类com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable 实例源码

项目:bobbybird    文件:BouncingImage.java   
public void draw (Batch batch, float parentAlpha) {
    validate();

    Color color = getColor();
    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);

    float x = getX();
    float y = getY() + floatAction.getValue();
    float scaleX = getScaleX();
    float scaleY = getScaleY();

    if (drawable instanceof TransformDrawable) {
        float rotation = getRotation();
        if (scaleX != 1 || scaleY != 1 || rotation != 0) {
            ((TransformDrawable)drawable).draw(batch, x + imageX, y + imageY, getOriginX() - imageX, getOriginY() - imageY,
                imageWidth, imageHeight, scaleX, scaleY, rotation);
            return;
        }
    }
    if (drawable != null) drawable.draw(batch, x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
}
项目:libgdxcn    文件:Image.java   
public void draw (Batch batch, float parentAlpha) {
    validate();

    Color color = getColor();
    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);

    float x = getX();
    float y = getY();
    float scaleX = getScaleX();
    float scaleY = getScaleY();

    if (drawable instanceof TransformDrawable) {
        float rotation = getRotation();
        if (scaleX != 1 || scaleY != 1 || rotation != 0) {
            ((TransformDrawable)drawable).draw(batch, x + imageX, y + imageY, getOriginX() - imageX, getOriginY() - imageY,
                imageWidth, imageHeight, scaleX, scaleY, rotation);
            return;
        }
    }
    if (drawable != null) drawable.draw(batch, x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
}
项目:libgdxcn    文件:CpuSpriteBatchTest.java   
public DrawableActor (TransformDrawable drawable) {
    this.drawable = drawable;
    setSize(drawable.getMinWidth(), drawable.getMinHeight());
}