Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void textBounds(RectangleX value)
 {
     createTextField();
     mTextBounds = value.clone();
 }
Ejemplo n.º 3
0
 /** The bounds of the textfield on the button. Allows moving the text to a custom position. */
 public RectangleX textBounds()
 {
     return(mTextBounds.clone());
 }