SFML-2.3.2: SFML bindings

Safe HaskellNone
LanguageHaskell98

SFML.Graphics.Transform

Synopsis

Documentation

data Transform Source

Encapsulate a 3x3 transform matrix.

createTransform Source

Arguments

:: Float

Element (0, 0) of the matrix

-> Float

Element (0, 1) of the matrix

-> Float

Element (0, 2) of the matrix

-> Float

Element (1, 0) of the matrix

-> Float

Element (1, 1) of the matrix

-> Float

Element (1, 2) of the matrix

-> Float

Element (2, 0) of the matrix

-> Float

Element (2, 1) of the matrix

-> Float

Element (2, 2) of the matrix

-> Transform 

Create a new transform from a matrix.

idTransform :: Transform Source

Identity transform.

translation Source

Arguments

:: Float

Offset to apply on X axis

-> Float

Offset to apply on Y axis

-> Transform 

Create a translation.

rotation Source

Arguments

:: Float

Rotation angle in degrees

-> Transform 

Create a rotation.

rotationWithCenter Source

Arguments

:: Float

Rotation angle, in degrees

-> Float

X coordinate of the center of rotation

-> Float

Y coordinate of the center of rotation

-> Transform 

Create 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)].

scaling Source

Arguments

:: Float

Scaling factor on the X axis

-> Float

Scaling factor on the Y axis

-> Transform 

Create a scaling.

scalingWithCenter Source

Arguments

:: Float

Scaling factor on X axis

-> Float

Scaling factor on Y axis

-> Float

X coordinate of the center of scaling

-> Float

Y coordinate of the center of scaling

-> Transform 

Create 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)]

inverse :: Transform -> Transform Source

Return the inverse of a transform.

If the inverse cannot be computed, a new identity transform is returned.

fastInverse :: Transform -> Transform Source

Return the inverse of a transform.

This function is only applicable when the transform is composed of rotations and translations only.

transformPoint :: Transform -> Vec2f -> Vec2f Source

Apply a transform to a 2D point.

transformDir :: Transform -> Vec2f -> Vec2f Source

Apply a transform to a 2D direction vector.

transformRect :: Transform -> FloatRect -> FloatRect Source

Apply a transform to 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.