use of org.terasology.rendering.nui.ScaleMode in project Terasology by MovingBlocks.
the class UIImage method onDraw.
@Override
public void onDraw(Canvas canvas) {
if (image.get() != null) {
if (ignoreAspectRatio) {
ScaleMode scaleMode = canvas.getCurrentStyle().getTextureScaleMode();
canvas.getCurrentStyle().setTextureScaleMode(ScaleMode.STRETCH);
canvas.drawTexture(image.get(), tint.get());
canvas.getCurrentStyle().setTextureScaleMode(scaleMode);
} else {
canvas.drawTexture(image.get(), tint.get());
}
}
}
Aggregations