Nez.Vector2Ext.round C# (CSharp) Méthode

round() private méthode

private round ( this vec ) : Vector2
vec this
Résultat Microsoft.Xna.Framework.Vector2
		public static Vector2 round( this Vector2 vec )
		{
			return new Vector2( Mathf.round( vec.X ), Mathf.round( vec.Y ) );
		}

Same methods

Vector2Ext::round ( Vector2 &vec ) : void

Usage Example

Exemple #1
0
        /// <summary>
        /// sets the position of the transform relative to the parent transform. If the transform has no parent, it is the same
        /// as Transform.position
        /// </summary>
        /// <returns>The local position.</returns>
        /// <param name="localPosition">Local position.</param>
        public Transform setLocalPosition(Vector2 localPosition)
        {
            if (shouldRoundPosition)
            {
                Vector2Ext.round(ref localPosition);
            }

            if (localPosition == _localPosition)
            {
                return(this);
            }

            _localPosition = localPosition;
            _localDirty    = _positionDirty = _localPositionDirty = _localRotationDirty = _localScaleDirty = true;
            setDirty(DirtyType.PositionDirty);

            return(this);
        }