Nez.RectangleExt.fromFloats C# (CSharp) Méthode

fromFloats() public static méthode

returns a rectangle from the passed in floats
public static fromFloats ( float x, float y, float width, float height ) : Rectangle
x float The x coordinate.
y float The y coordinate.
width float Width.
height float Height.
Résultat Microsoft.Xna.Framework.Rectangle
		public static Rectangle fromFloats( float x, float y, float width, float height )
		{
			return new Rectangle( (int)x, (int)y, (int)width, (int)height );
		}

Usage Example

Exemple #1
0
        public override void Render(Graphics graphics, Camera camera)
        {
            var topLeft         = Entity.transform.position + localOffset;
            var destinationRect = RectangleExt.fromFloats(topLeft.X, topLeft.Y, _sourceRect.Width * Entity.transform.scale.X * TextureScale.X, _sourceRect.Height * Entity.transform.scale.Y * TextureScale.Y);

            graphics.batcher.draw(Subtexture, destinationRect, _sourceRect, Color, Entity.transform.rotation, Origin * _inverseTexScale, SpriteEffects, layerDepth);
        }
All Usage Examples Of Nez.RectangleExt::fromFloats