Example usage for com.badlogic.gdx.scenes.scene2d.ui Widget setSize

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Widget setSize

Introduction

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

Prototype

public void setSize(float width, float height) 

Source Link

Document

Sets the width and height.

Usage

From source file:net.dermetfan.gdx.scenes.scene2d.ui.UIUtils.java

License:Apache License

/** @param widget the Widget to resize according to its min, pref and max size
 *  @deprecated seems unnecessary and with no known use case */
@Deprecated//from w  ww  .j a  va 2s.  c o m
public static void layoutSize(Widget widget) {
    widget.setSize(
            MathUtils.clamp(widget.getPrefWidth(), widget.getMinWidth(),
                    widget.getMaxWidth() == 0 ? Float.POSITIVE_INFINITY : widget.getMaxWidth()),
            MathUtils.clamp(widget.getPrefHeight(), widget.getMinHeight(),
                    widget.getMaxHeight() == 0 ? Float.POSITIVE_INFINITY : widget.getMaxHeight()));
}