Download Now

    Reference IMatrix

    Declared in Codebot.Render.Graphics.pas on line 84

    IMatrix is a 2D transform, created with NewMatrix
      IMatrix = interface
      public
        { Set the six values of the matrix }
        procedure Copy(A, B, C, D, E, F: Float); overload;
        { Copy the values of another matrix }
        procedure Copy(M: IMatrix); overload;
        { Reset to the identity matrix }
        procedure Identity;
        { Returns the inverse as a new matrix }
        function Inverse: IMatrix;
        { Move by an offset }
        procedure Translate(X, Y: Float);
        { Rotate by an angle }
        procedure Rotate(Angle: Float);
        { Rotate by an angle about a point }
        procedure RotateAt(Angle, X, Y: Float);
        { Scale along each axis }
        procedure Scale(SX, SY: Float);
        { Scale along each axis about a point }
        procedure ScaleAt(SX, SY, X, Y: Float);
        { Skew along the x axis }
        procedure SkewX(X: Float);
        { Skew along the y axis }
        procedure SkewY(Y: Float);
        { Combine with another matrix }
        procedure Transform(M: IMatrix);
        { Creates new matrix C using the formula: C = A * B A is this matrix, B is
          the matrix passed below, and C is the result }
        function Multiply(M: IMatrix): IMatrix; overload;
        { Creates a new point C using the formula: C = A * B A is this matrix, B is
          the point passed below, and C is the result }
        function Multiply(const P: TPointF): TPointF; overload;
        { Preserve the matrix state by pushing it onto a stack }
        procedure Push;
        { Restore the matrix state by popping it from a stack }
        procedure Pop;
      end;

    See also

    Float in Codebot.System.pas
    TPointF in Codebot.Graphics.Types.pas