public RectF get( int index ) { float x = index % cols; float y = index / cols; float l = uvLeft + x * uvWidth; float t = uvTop + y * uvHeight; return new RectF( l, t, l + uvWidth, t + uvHeight ); }
public RectF uvRect( float left, float top, float right, float bottom ) { return new RectF( left / width, top / height, right / width, bottom / height ); } }
public static RectF uvRect( SmartTexture tx, int left, int top, int right, int bottom ) { return new RectF( (float)left / tx.width, (float)top / tx.height, (float)right / tx.width, (float)bottom / tx.height ); } }
public RectF uvRect( float left, float top, float right, float bottom ) { return new RectF( left / width, top / height, right / width, bottom / height ); } }
public RectF get( int index ) { float x = index % cols; float y = index / cols; float l = uvLeft + x * uvWidth; float t = uvTop + y * uvHeight; return new RectF( l, t, l + uvWidth, t + uvHeight ); }
public static RectF uvRect( SmartTexture tx, int left, int top, int right, int bottom ) { return new RectF( (float)left / tx.width, (float)top / tx.height, (float)right / tx.width, (float)bottom / tx.height ); } }
public RectF frame() { return new RectF( frame ); }
public RectF shrink( float d ) { return new RectF( left + d, top + d, right - d, bottom - d ); }
public RectF shrink( float d ) { return new RectF( left + d, top + d, right - d, bottom - d ); }
public RectF frame() { return new RectF( frame ); }
public RectF union( RectF other ){ RectF result = new RectF(); result.left = Math.min( left, other.left ); result.right = Math.max( right, other.right ); result.top = Math.min( top, other.top ); result.bottom = Math.max( bottom, other.bottom ); return result; }
public RectF intersect( RectF other ) { RectF result = new RectF(); result.left = Math.max( left, other.left ); result.right = Math.min( right, other.right ); result.top = Math.max( top, other.top ); result.bottom = Math.min( bottom, other.bottom ); return result; }
public RectF intersect( RectF other ) { RectF result = new RectF(); result.left = Math.max( left, other.left ); result.right = Math.min( right, other.right ); result.top = Math.max( top, other.top ); result.bottom = Math.min( bottom, other.bottom ); return result; }
public RectF union( RectF other ){ RectF result = new RectF(); result.left = Math.min( left, other.left ); result.right = Math.max( right, other.right ); result.top = Math.min( top, other.top ); result.bottom = Math.max( bottom, other.bottom ); return result; }
@Override public void frame( RectF frame ) { scaleX = 1; scaleY = 1; offsetX = 0; offsetY = 0; super.frame( new RectF( 0, 0, 1, 1 ) ); }
@Override public void frame( RectF frame ) { scaleX = 1; scaleY = 1; offsetX = 0; offsetY = 0; super.frame( new RectF( 0, 0, 1, 1 ) ); }
public void texture( Object tx ) { texture = tx instanceof SmartTexture ? (SmartTexture)tx : TextureCache.get( tx ); frame( new RectF( 0, 0, 1, 1 ) ); }
public void copy( Image other ) { texture = other.texture; frame = new RectF( other.frame ); width = other.width; height = other.height; updateFrame(); updateVertices(); }
public void texture( Object tx ) { texture = tx instanceof SmartTexture ? (SmartTexture)tx : TextureCache.get( tx ); frame( new RectF( 0, 0, 1, 1 ) ); }
public void copy( Image other ) { texture = other.texture; frame = new RectF( other.frame ); width = other.width; height = other.height; updateFrame(); updateVertices(); }