Affine.Scale C# (CSharp) Method

Scale() public method

public Scale ( float sx, float sy ) : bool
sx float
sy float
return bool
	public bool Scale(float sx, float sy)
	{
		if ((sx == 0) || (sy == 0))
			return false;

		fMatrix.eM11 *= sx;
		fMatrix.eM12 *= sx;
		fMatrix.eM21 *= sy;
		fMatrix.eM22 *= sy;
		fMatrix.eDx *= sx;
		fMatrix.eDy *= sy;

		return true;
	}

Usage Example

Example #1
0
        public void DrawCircle(Vector2 pos, float radius, float z, Color4 color, float borderThickness, Color4 borderColor)
        {
            var innerRadius = radius - borderThickness;
            var outer       = Affine.Translation(pos) * Affine.Scale(radius);
            var inner       = Affine.Translation(pos) * Affine.Scale(innerRadius);

            _chunkBuffer.AddConvexChunk(_unitCircleVerts, z, color, inner);
            _chunkBuffer.AddBorderChunk(_unitCircleVerts.Select(x => inner * x).ToArray(),
                                        _unitCircleVerts.Select(x => outer * x).ToArray(),
                                        z, borderColor);
        }
All Usage Examples Of Affine::Scale