I want the actor to draw stretchable, but snap it to the size of the actor. I derived this class from Widget and used some hardcoded values as a simple test:
public class MyWidget extends Widget {
public MyWidget(Drawable drawable) {
setDrawable(drawable);
setSize(100, 100);
}
public void draw(Batch batch, float parentAlpha) {
clipBegin(getX(), getY(), 20, 20);
drawable.draw(batch, getX(), getY(), 500, 500);
clipEnd();
}
}
No pruning is performed, although pushed spills out of the actor's limits. This actor is part of the table, if that matters. I believe that I am using clipBegin () / clipEnd () methods incorrectly. What is the right way to do this?
thank
source
share