BBGamelib.CCLabelTTF.updateTransform C# (CSharp) Method

updateTransform() public method

public updateTransform ( ) : void
return void
		public override void updateTransform ()
		{
			base.updateTransform ();
			if (_isContentDirty) {
				Vector2 contentPosition = _contentSize / 2;
				Bounds localBounds = getLocalbounds();
				Vector2 textSize = ccUtils.UnitsToPixels (localBounds.size);
				if(verticalAlignment == CCVerticalTextAlignment.Top){
					contentPosition.y = _contentSize.y - textSize.y/2;
				}else if(verticalAlignment == CCVerticalTextAlignment.Bottom){
					contentPosition.y = textSize.y/2;
				}
				if(horizontalAlignment == CCTextAlignment.Right){
					contentPosition.x = _contentSize.x - textSize.x/2;
				}else if(horizontalAlignment == CCTextAlignment.Left){
					contentPosition.x = textSize.x/2;
				}

				contentPosition -= _anchorPointInPixels;
				Vector2 pInUIUnits = ccUtils.PixelsToUnits (contentPosition);
				_content.transform.localPosition = new Vector3(pInUIUnits.x, pInUIUnits.y, _content.transform.localPosition.z);

		
				//rotation
				Vector3 rotation = _content.transform.localEulerAngles;
				rotation.y = 0;
				rotation.z = 0;
				if (_flipX) {
					rotation.y = 180;
				} 
				if (_flipY) {
					rotation.y = _flipX ? 0 : 180;
					rotation.z = 180;
				}
				_content.transform.localEulerAngles = rotation;
				_isContentDirty = false;
			}
		}
		#endregion