public SubTextureX(TextureX parentTexture, RectangleX region, RectangleX frame = null) { if (region == null) { region = new RectangleX(0, 0, parentTexture.width, parentTexture.height); } mParent = parentTexture; mFrame = frame != null?frame.clone() : null; mWidth = region.width; mHeight = region.height; mTransform = new Transform2X(); mTransform.scale(region.width / mParent.width, region.height / mParent.height); mTransform.translate(region.x / mParent.width, -1 - region.y / mParent.height); }
public void textBounds(RectangleX value) { createTextField(); mTextBounds = value.clone(); }
/** The bounds of the textfield on the button. Allows moving the text to a custom position. */ public RectangleX textBounds() { return(mTextBounds.clone()); }