C# Класс SFML.Graphics.Transform

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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).

Приватные методы

Метод Описание
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

Описание методов

Combine() публичный Метод

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
Результат void

GetInverse() публичный Метод

Return the inverse of the transform. If the inverse cannot be computed, an identity transform is returned.
public GetInverse ( ) : Transform
Результат Transform

Rotate() публичный Метод

Combine the current transform with a rotation.
public Rotate ( float angle ) : void
angle float Rotation angle, in degrees
Результат void

Rotate() публичный Метод

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
Результат void

Rotate() публичный Метод

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
Результат void

Scale() публичный Метод

Combine the current transform with a scaling.
public Scale ( Vector2f factors ) : void
factors Vector2f Scaling factors
Результат void

Scale() публичный Метод

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
Результат void

Scale() публичный Метод

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
Результат void

Scale() публичный Метод

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
Результат void

ToString() публичный Метод

Provide a string describing the object
public ToString ( ) : string
Результат string

Transform() публичный Метод

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
Результат System.Runtime.InteropServices

TransformPoint() публичный Метод

Transform a 2D point.
public TransformPoint ( Vector2f point ) : Vector2f
point Vector2f Point to transform
Результат Vector2f

TransformPoint() публичный Метод

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
Результат Vector2f

TransformRect() публичный Метод

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
Результат FloatRect

Translate() публичный Метод

Combine the current transform with a translation.
public Translate ( Vector2f offset ) : void
offset Vector2f Translation offset to apply
Результат void

Translate() публичный Метод

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
Результат void

operator() публичный статический Метод

Overload of binary operator * to combine two transforms. This call is equivalent to calling new Transform(left).Combine(right).
public static operator ( ) : Transform
Результат Transform

operator() публичный статический Метод

Overload of binary operator * to transform a point. This call is equivalent to calling left.TransformPoint(right).
public static operator ( ) : Vector2f
Результат Vector2f