C# Class SFML.Graphics.Transform

ファイルを表示 Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
Combine ( Transform transform ) : void

Combine the current transform with another one. The result is a transform that is equivalent to applying this followed by transform. Mathematically, it is equivalent to a matrix multiplication.

GetInverse ( ) : Transform

Return the inverse of the transform. If the inverse cannot be computed, an identity transform is returned.

Rotate ( float angle ) : void

Combine the current transform with a rotation.

Rotate ( float angle, Vector2f center ) : void

Combine the current transform with a rotation. The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual Translate(-center); Rotate(angle); Translate(center).

Rotate ( float angle, float centerX, float centerY ) : void

Combine the current transform with a rotation. The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual Translate(-center); Rotate(angle); Translate(center).

Scale ( Vector2f factors ) : void

Combine the current transform with a scaling.

Scale ( Vector2f factors, Vector2f center ) : void

Combine the current transform with a scaling. The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual Translate(-center); Scale(factors); Translate(center).

Scale ( float scaleX, float scaleY ) : void

Combine the current transform with a scaling.

Scale ( float scaleX, float scaleY, float centerX, float centerY ) : void

Combine the current transform with a scaling. The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual Translate(-center); Scale(factors); Translate(center).

ToString ( ) : string

Provide a string describing the object

Transform ( float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22 ) : System.Runtime.InteropServices

Construct a transform from a 3x3 matrix

TransformPoint ( Vector2f point ) : Vector2f

Transform a 2D point.

TransformPoint ( float x, float y ) : Vector2f

Transform a 2D point.

TransformRect ( FloatRect rectangle ) : FloatRect

Transform a rectangle. Since SFML doesn't provide support for oriented rectangles, the result of this function is always an axis-aligned rectangle. Which means that if the transform contains a rotation, the bounding rectangle of the transformed rectangle is returned.

Translate ( Vector2f offset ) : void

Combine the current transform with a translation.

Translate ( float x, float y ) : void

Combine the current transform with a translation.

operator ( ) : Transform

Overload of binary operator * to combine two transforms. This call is equivalent to calling new Transform(left).Combine(right).

operator ( ) : Vector2f

Overload of binary operator * to transform a point. This call is equivalent to calling left.TransformPoint(right).

Private Methods

Method Description
sfTransform_combine ( Transform &transform, Transform &other ) : void
sfTransform_getInverse ( Transform &transform ) : Transform
sfTransform_rotate ( Transform &transform, float angle ) : void
sfTransform_rotateWithCenter ( Transform &transform, float angle, float centerX, float centerY ) : void
sfTransform_scale ( Transform &transform, float scaleX, float scaleY ) : void
sfTransform_scaleWithCenter ( Transform &transform, float scaleX, float scaleY, float centerX, float centerY ) : void
sfTransform_transformPoint ( Transform &transform, Vector2f point ) : Vector2f
sfTransform_transformRect ( Transform &transform, FloatRect rectangle ) : FloatRect
sfTransform_translate ( Transform &transform, float x, float y ) : void

Method Details

Combine() public method

Combine the current transform with another one. The result is a transform that is equivalent to applying this followed by transform. Mathematically, it is equivalent to a matrix multiplication.
public Combine ( Transform transform ) : void
transform Transform Transform to combine to this transform
return void

GetInverse() public method

Return the inverse of the transform. If the inverse cannot be computed, an identity transform is returned.
public GetInverse ( ) : Transform
return Transform

Rotate() public method

Combine the current transform with a rotation.
public Rotate ( float angle ) : void
angle float Rotation angle, in degrees
return void

Rotate() public method

Combine the current transform with a rotation. The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual Translate(-center); Rotate(angle); Translate(center).
public Rotate ( float angle, Vector2f center ) : void
angle float Rotation angle, in degrees
center Vector2f Center of rotation
return void

Rotate() public method

Combine the current transform with a rotation. The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual Translate(-center); Rotate(angle); Translate(center).
public Rotate ( float angle, float centerX, float centerY ) : void
angle float Rotation angle, in degrees
centerX float X coordinate of the center of rotation
centerY float Y coordinate of the center of rotation
return void

Scale() public method

Combine the current transform with a scaling.
public Scale ( Vector2f factors ) : void
factors Vector2f Scaling factors
return void

Scale() public method

Combine the current transform with a scaling. The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual Translate(-center); Scale(factors); Translate(center).
public Scale ( Vector2f factors, Vector2f center ) : void
factors Vector2f Scaling factors
center Vector2f Center of scaling
return void

Scale() public method

Combine the current transform with a scaling.
public Scale ( float scaleX, float scaleY ) : void
scaleX float Scaling factor on the X axis
scaleY float Scaling factor on the Y axis
return void

Scale() public method

Combine the current transform with a scaling. The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual Translate(-center); Scale(factors); Translate(center).
public Scale ( float scaleX, float scaleY, float centerX, float centerY ) : void
scaleX float Scaling factor on X axis
scaleY float Scaling factor on Y axis
centerX float X coordinate of the center of scaling
centerY float Y coordinate of the center of scaling
return void

ToString() public method

Provide a string describing the object
public ToString ( ) : string
return string

Transform() public method

Construct a transform from a 3x3 matrix
public Transform ( float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22 ) : System.Runtime.InteropServices
a00 float Element (0, 0) of the matrix
a01 float Element (0, 1) of the matrix
a02 float Element (0, 2) of the matrix
a10 float Element (1, 0) of the matrix
a11 float Element (1, 1) of the matrix
a12 float Element (1, 2) of the matrix
a20 float Element (2, 0) of the matrix
a21 float Element (2, 1) of the matrix
a22 float Element (2, 2) of the matrix
return System.Runtime.InteropServices

TransformPoint() public method

Transform a 2D point.
public TransformPoint ( Vector2f point ) : Vector2f
point Vector2f Point to transform
return Vector2f

TransformPoint() public method

Transform a 2D point.
public TransformPoint ( float x, float y ) : Vector2f
x float X coordinate of the point to transform
y float Y coordinate of the point to transform
return Vector2f

TransformRect() public method

Transform a rectangle. Since SFML doesn't provide support for oriented rectangles, the result of this function is always an axis-aligned rectangle. Which means that if the transform contains a rotation, the bounding rectangle of the transformed rectangle is returned.
public TransformRect ( FloatRect rectangle ) : FloatRect
rectangle FloatRect Rectangle to transform
return FloatRect

Translate() public method

Combine the current transform with a translation.
public Translate ( Vector2f offset ) : void
offset Vector2f Translation offset to apply
return void

Translate() public method

Combine the current transform with a translation.
public Translate ( float x, float y ) : void
x float Offset to apply on X axis
y float Offset to apply on Y axis
return void

operator() public static method

Overload of binary operator * to combine two transforms. This call is equivalent to calling new Transform(left).Combine(right).
public static operator ( ) : Transform
return Transform

operator() public static method

Overload of binary operator * to transform a point. This call is equivalent to calling left.TransformPoint(right).
public static operator ( ) : Vector2f
return Vector2f