Exemple #1
0
		public override void onEntityTransformChanged( Transform.Component comp )
		{
			base.onEntityTransformChanged( comp );

			// our sprite is disabled so we need to forward the call over to it so it can update its bounds for rendering
			_sprite.onEntityTransformChanged( comp );
		}
Exemple #2
0
		public override void onEntityTransformChanged( Transform.Component comp )
		{
			forceMatrixUpdate();
		}
Exemple #3
0
		public InspectorList( Transform transform )
		{
			name = "Transform";
			_inspectors = Inspector.getTransformProperties( transform );
		}
Exemple #4
0
        /// <summary>
        /// sets the parent Transform of this Transform
        /// </summary>
        /// <returns>The parent.</returns>
        /// <param name="parent">Parent.</param>
        public Transform setParent( Transform parent )
        {
            if( _parent == parent )
                return this;

            if( _parent != null )
                _parent._children.Remove( this );

            if( parent != null )
                parent._children.Add( this );

            _parent = parent;
            setDirty( DirtyType.PositionDirty );

            return this;
        }
Exemple #5
0
        public void copyFrom( Transform transform )
        {
            _position = transform.position;
            _localPosition = transform._localPosition;
            _rotation = transform._rotation;
            _localRotation = transform._localRotation;
            _scale = transform._scale;
            _localScale = transform._localScale;

            //			hierarchyDirty |= DirtyType.PositionDirty;
            //			hierarchyDirty |= DirtyType.RotationDirty;
            //			hierarchyDirty |= DirtyType.ScaleDirty;
            setDirty( DirtyType.PositionDirty );
            setDirty( DirtyType.RotationDirty );
            setDirty( DirtyType.ScaleDirty );
        }
Exemple #6
0
		public override void onEntityTransformChanged( Transform.Component comp )
		{
			// set the appropriate dirty flags
			switch( comp )
			{
				case Transform.Component.Position:
					_isPositionDirty = true;
					break;
				case Transform.Component.Scale:
					_isPositionDirty = true;
					break;
				case Transform.Component.Rotation:
					_isRotationDirty = true;
					break;
			}

			if( _isColliderRegistered )
				Physics.updateCollider( this );
		}
Exemple #7
0
		public static Entity setParent( this Entity self, Transform parent )
		{
			self.transform.setParent( parent );
			return self;
		}
Exemple #8
0
		public override void onEntityTransformChanged( Transform.Component comp )
		{
			// we dont care if the transform changed if we are in world space
			if( useWorldSpace )
				return;

			_bounds.calculateBounds( entity.transform.position, _localOffset, Vector2.Zero, entity.transform.scale, entity.transform.rotation, width, height );
		}
Exemple #9
0
		public override void onEntityTransformChanged( Transform.Component comp )
		{
			// we only deal with positional changes here. TiledMaps cant be scaled.
			if( _shouldCreateColliders && comp == Transform.Component.Position )
			{
				removeColliders();
				addColliders();
			}
		}