I would suggest that the code should follow the same steps as the ctor sprite (texture) :
public Sprite (Texture texture) { this(texture, 0, 0, texture.getWidth(), texture.getHeight()); } public Sprite (Texture texture, int srcX, int srcY, int srcWidth, int srcHeight) { if (texture == null) throw new IllegalArgumentException("texture cannot be null."); this.texture = texture; setRegion(srcX, srcY, srcWidth, srcHeight); setColor(1, 1, 1, 1); setSize(Math.abs(srcWidth), Math.abs(srcHeight)); setOrigin(width / 2, height / 2); }
These are all publicly available methods.
source share